Sponsored Content
Full Discussion: GCC Alignment pragma
Top Forums Programming GCC Alignment pragma Post 302950998 by Pug on Friday 31st of July 2015 03:10:47 AM
Old 07-31-2015
GCC Alignment pragma

Quick question for the community of GCC programmers.

I have code that uses:

Code:
#pragma align 4

(as an example).

Now this code has compiled for many years on a few different platforms and GCC versions.

Recently I got warning messages about it (using gcc 4.9.2 on Solaris) and I wondered why. Upon further investigation it turns out the GCC documented method is:

Code:
#pragma pack(4)

My question is, when did that change? I have no problem using pack(#) instead but I am wondering why I have never seen this warning until now if all the document cation going back to 4.2 3 refers to the pack() pragma.

Does anyone know the story here?

Is align just something the compiler accepted for backward compatibility?

Are there old GCC compilers that don't support the pragma pack()?

Just wondering.

Thanks!

Last edited by Don Cragun; 01-14-2016 at 03:19 AM.. Reason: Add CODE and ICODE tags.
 

9 More Discussions You Might Find Interesting

1. Programming

How use #pragma pack() in HP unix ?

hello. i use follow sentences in include files in SCO unix is ok. #pragma pack(1) struct dddd { int iD1; char cCh1; ... }; #pragma pack() but in hp-9000 unix , not ok when compiling, cc not support #pragma pack(1) how to settle the question ? ... (1 Reply)
Discussion started by: bdyjm
1 Replies

2. UNIX for Dummies Questions & Answers

Column Alignment

I copied a word file to my Unix directory, How do I line up my columns to the file I copied over? (3 Replies)
Discussion started by: nikncha
3 Replies

3. Shell Programming and Scripting

alignment of variable

Dear Champs, i have a file let a.txt having value number text 00 123 012 145 456 ...etc i need number and text column vales should right align ??? how can i achive this ??? NOTE number is of max 3 char and text can take max 7 char...so if any records are less than above lengths... (2 Replies)
Discussion started by: manas_ranjan
2 Replies

4. Solaris

Installing gcc - recieve error message gcc : cannot execute

AIM- Install Oracle 11g on Solaris using VMWare Steps 1.Logged on as root 2.Created subfolders à /usr/local/bin & /usr/local/bin/gcc 3.Downloaded gcc & libiconv & unzipped them on my harddrive & burnt them on CD 4.Copied files from CD to /usr/local/bin/gcc 5.Terminal (root) à pkgadd -d... (8 Replies)
Discussion started by: Ackers
8 Replies

5. Programming

pragma page

Hi, I have a question regarding pragma page. What is the advantage of using this pragma? Also the description tells that it is a compiler directive to start of in a new page. Does the page here refer to the page in memory where the set of code under the pragma page will be starting in a new... (3 Replies)
Discussion started by: naan
3 Replies

6. Shell Programming and Scripting

alignment

Hi, I am having a file with with format. however, for longer xml, the xml code has been truncated like this. F1 |###################### |String1 |<XML><REQ><MSGTYPE>DBDIRECT</MSGTYPE><SYNC>0</SYNC><CLIENT>C11</CLIENT>NAME=MYNAME|JOB=MYJOB| | ... (3 Replies)
Discussion started by: shellwell
3 Replies

7. Programming

#pragma warn codes on Sun Solaris to disable some warns?

I am not able to find warn-codes that should be used in #pragma warn -<code> directive!:wall: Could anybody advise where I can see a list of warnings with codes that (as I understand) should be 3-letters code? I have a pro-C program that produces some warnings. (Do not advise,... (4 Replies)
Discussion started by: alex_5161
4 Replies

8. Shell Programming and Scripting

Row alignment

*1 flash read test(*do_test1*) PASS *2 xxxxxxxxxxx flash write test(*do_test2) FAIL ------>xxxxx *1 flash read test(*do_test1*) PASS *2 xxxxxxxxxxx flash write test(*do_test2) FAIL ------>xxxxx I want pass and Fail to be aligned if each line uses printf or echo to print, is... (5 Replies)
Discussion started by: yanglei_fage
5 Replies

9. UNIX for Beginners Questions & Answers

Help with awk alignment

Dear All, I am in the beginning stage of learning shell scripting and preparing shell script on my own now. I would like to get help from fellow mates here. As I am trying to take O/P with space included from I/P table. Kindly guide me to align given I/P table as Expected O/P. ... (5 Replies)
Discussion started by: Raja007
5 Replies
fe_dec_setround(3M)													       fe_dec_setround(3M)

NAME
fe_dec_setround() - set decimal floating-point rounding direction mode SYNOPSIS
DESCRIPTION
The function establishes the decimal rounding direction represented by its argument round. The round argument must equal one of the macros (defined in and If the argument does not match a decimal rounding direction macro, the decimal rounding direction is not changed. The default decimal rounding direction mode is round to nearest with half-way cases away from zero These math functions are supported for HP-UX 11i Version 3 September 2008 Update and forward. USAGE
To use this function, compile with the option. Make sure your program defines and then includes Specify on the compiler command line or place the call to this function under the effect of an affirmative pragma: If the pragma is placed outside of any top-level declarations in a file, the pragma will apply until another pragma is encountered or until the end of the file is reached. If the pragma is placed at the beginning of a block (compound statement), the pragma will apply until another pragma is encountered or until the end of the block is reached. Link in the math library by specifying or on the linking command line. For more information, see the at the following site: RETURN VALUE
The function returns a zero value if and only if the argument is equal to a decimal rounding direction macro. SEE ALSO
fe_dec_getround(3M), fenv(5). STANDARDS CONFORMANCE
This function conforms to ISO/IEC TR 24732, "Extension for the programming language C to support decimal floating-point arithmetic". fe_dec_setround(3M)
All times are GMT -4. The time now is 10:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy