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]

Re: fix handling of '#pragma pack(pop [, id])'


"Zack Weinberg" <zackw@stanford.edu> writes:
> You must not use a variable to hold an error message, or message
> translation will break.  You have to do it like this:

Ok, I didn't know about this.

> > !   if (action != pop)
> > !     switch (align)
> > !       {
> > !       case 0:
> > !       case 1:
> > !       case 2:
> > !       case 4:
> > !       case 8:
> > !       case 16:
> > ! 	align *= BITS_PER_UNIT;
> > ! 	break;
> > !       default:
> > ! 	BAD2 ("alignment must be a small power of two, not %d", align);
> > !       }
> 
> Better you should set align to zero at the beginning of the function
> and leave the switch alone.

That would also work.  I put the 'action != pop' check in to make it clearer
to the reader that the switch didn't apply in the 'pop' case.  Personal
taste--your way is fine with me.

Do I need to submit a revised patch?

--Mike


-- 
[O]ne of the features of the Internet [...] is that small groups of people can
greatly disturb large organizations.  --Charles C. Mann

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