This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: make #pragma pack() implementation consistent with othercompilers (PR c/7054)


Second try, (hopefully) with all complaints addressed. Bootstrapped and
tested on i686-pc-linux-gnu. Jan

>>> "Joseph S. Myers" <jsm@polyomino.org.uk> 07.07.04 14:07:45 >>>
On Wed, 7 Jul 2004, Jan Beulich wrote:

> 2004-07-07 Jan Beulich <jbeulich@novell.com>
> 
> 	PR c/7054
> 	* tree.h (initial_max_fld_align): Declare
> 	* stor-layout.c (initial_max_fld_align): Define and initialize.
> 	(maximum_field_alignment): Initialize to the same value.
> 	* common.opt: Add -fpack-struct= variant of switch.
> 	* opts.c: Handle -fpack-struct= variant of switch.
> 	* c-pragma.c: Change #pragma pack() handling so that is becomes
> 	compatible to other compilers: accept individual 'push'
> argument,
> 	make final pop restore (command line) default, correct
> interaction
> 	of push/pop and sole specification of a new alignment (so that
> the
> 	sequence #pragma pack(push) - #pragma pack(<n>) becomes
> identical
> 	to #pragma pack(push, <n>).
> 	* testsuite/gcc.dg/pack-test-2.c: Adjust to permit and check
> 	#pragma pack(push).

We can't consider patches without proper documentation.  This needs (a)
 
documentation for the new command-line option syntax, (b)
documentation
for the pragma changes (and it seems for the pragma itself, which as
you
evidently understand what it's meant to do at present you're best
placed
to write), (c) for what seems to be a new target macro
DEFAULT_PACK_STRUCT.

>
/home/jbeulich/src/gcc/mainline/2004-07-05.10.09/gcc/testsuite/g++.dg/abi/vbase10.C	2004-01-08
> 04:32:11.000000000 +0100
> +++
> 2004-07-05.10.09/gcc/testsuite/g++.dg/abi/vbase10.C	2004-05-27
> 10:57:09.000000000 +0200

Not mentioned in the ChangeLog entry.  Why is this testcase being
changed?

>
/home/jbeulich/src/gcc/mainline/2004-07-05.10.09/gcc/testsuite/gcc.dg/Wpadded.c	2003-06-10
> 01:04:50.000000000 +0200
> +++ 2004-07-05.10.09/gcc/testsuite/gcc.dg/Wpadded.c	2004-05-26
> 15:38:24.000000000 +0200

Likewise.

>
/home/jbeulich/src/gcc/mainline/2004-07-05.10.09/gcc/testsuite/gcc.dg/c99-flex-array-4.c	2002-08-17
> 16:48:28.000000000 +0200
> +++
>
2004-07-05.10.09/gcc/testsuite/gcc.dg/c99-flex-array-4.c	2004-05-26
> 17:19:15.000000000 +0200

Likewise.  It seems clearly inappropriate for standards testcases to
have
any special options like you're adding.  (But this testcase is expected
to
become obsolete, as the draft C99 TC2 (N1060) would remove the
defective
requirement from the standard.)

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/ 
    jsm@polyomino.org.uk (personal mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)

Attachment: gcc-mainline-pragma-pack.patch
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]