No Subject

Nick Clifton nickc@cygnus.com
Tue Oct 6 09:51:00 GMT 1998


Hi,

  I would like to submit the following patch to the pragma handling
code in c-pragma.c.  It fixes a bug in the handling of '#pragma pack(<n>)' 
which was introduced by the HANDLE_PRAGMA_PACK_PUSH_POP patch.  The
bug was that insert_pack_attributes() was being called when #pragma
pack(<n>) was used, when the funciton is only intended to work with
#pragma pack(push,<n>).

Cheers
	Nick



Tue Oct  6 09:44:53 1998  Nick Clifton  <nickc@cygnus.com>

	* c-pragma.c (insert_pack_attributes): Do not insert
	attributes unless #pragma pack(push,<n>) is in effect.


Index: c-pragma.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/c-pragma.c,v
retrieving revision 1.9
diff -p -r1.9 c-pragma.c
*** c-pragma.c	1998/10/01 10:50:06	1.9
--- c-pragma.c	1998/10/06 16:44:17
*************** insert_pack_attributes (node, attributes
*** 146,152 ****
    tree a;
  
    /* If we are not packing, then there is nothing to do.  */
!   if (maximum_field_alignment == 0)
      return;
  
    /* We are only interested in fields.  */
--- 146,153 ----
    tree a;
  
    /* If we are not packing, then there is nothing to do.  */
!   if (maximum_field_alignment == 0
!       || alignment_stack == NULL)
      return;
  
    /* We are only interested in fields.  */



More information about the Gcc-patches mailing list