This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [gold patch]Fix gold build on MacOSX Xcode 3.2.6
"Doug Kwan (éæå)" <dougkwan@google.com> writes:
> [+iant]
> I don't have approval. You need to sent this to Ian.
>
> On Tue, Jun 5, 2012 at 10:59 AM, Jing Yu <jingyu@google.com> wrote:
>> The gcc 4.2.1 (Apple Inc. build 5666, dot 3) comes with Xcode 3.2.6
>> emits warning for "while (0);" and breaks the build (thanks to -Werror
>> which treat warning as error). ÂAdd "{}" to fix it.
That's wrong. When the macro is used, there will be a trailing
semicolon. The point of using "while (0)" is to safely swallow that
trailing semicolon.
Try this:
# define textdomain(Domainname) do {} while (0)
Ian
>> Gold make check passes on x86-64.
>>
>> 2012-06-05 ÂJing Yu Â<jingyu@google.com>
>>
>> Â Â Â Â* gold.h (textdomain): Add {} to empty while(0)
>> Â Â Â Â Â Â Â Â Â Â Â(bindtextdomain): Likewise
>>
>> Index: gold/gold.h
>> ===================================================================
>> RCS file: /cvs/src/src/gold/gold.h,v
>> retrieving revision 1.47
>> diff -u -r1.47 gold.h
>> --- gold/gold.h 8 Jun 2011 04:43:28 -0000 Â Â Â 1.47
>> +++ gold/gold.h 5 Jun 2012 17:46:46 -0000
>> @@ -58,8 +58,8 @@
>> Â# define gettext(Msgid) (Msgid)
>> Â# define dgettext(Domainname, Msgid) (Msgid)
>> Â# define dcgettext(Domainname, Msgid, Category) (Msgid)
>> -# define textdomain(Domainname) while (0) /* nothing */
>> -# define bindtextdomain(Domainname, Dirname) while (0) /* nothing */
>> +# define textdomain(Domainname) while (0) {} /* nothing */
>> +# define bindtextdomain(Domainname, Dirname) while (0) {} /* nothing */
>> Â# define _(String) (String)
>> Â# define N_(String) (String)
>> Â#endif