This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: fix handling of '#pragma pack(pop [, id])'
- To: "Zack Weinberg" <zackw at stanford dot edu>
- Subject: Re: fix handling of '#pragma pack(pop [, id])'
- From: Mike Coleman <mcoleman2 at kc dot rr dot com>
- Date: 30 Sep 2000 00:06:50 -0500
- Cc: Mike Coleman <mcoleman2 at kc dot rr dot com>, gcc-patches at gcc dot gnu dot org
- References: <m13fDpG-001qXNC@microdog><20000929215517.C623@wolery.stanford.edu>
"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