From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Tue, 19 Nov 2013 08:01:44 +0100 Subject: [U-Boot] [PATCH] cmd_test: fix a compile error on Blackfin In-Reply-To: <1384830117-25345-1-git-send-email-yamada.m@jp.panasonic.com> References: <1384830117-25345-1-git-send-email-yamada.m@jp.panasonic.com> Message-ID: <20131119070144.70D40380481@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Masahiro Yamada, In message <1384830117-25345-1-git-send-email-yamada.m@jp.panasonic.com> you wrote: > Before this commit, common/cmd_test.c defined > _STDBOOL_H in order to avoid including . > But this work-around is not a good idea. Actually it is a good idea, as it attempts to be independent of the actual implementation of the bool data types - it does the same no matter if "true" and "flase" are members or a union or #define'd constants. > --- a/common/cmd_test.c > +++ b/common/cmd_test.c > @@ -5,15 +5,6 @@ > * SPDX-License-Identifier: GPL-2.0+ > */ > > -/* > - * Define _STDBOOL_H here to avoid macro expansion of true and false. > - * If the future code requires macro true or false, remove this define > - * and undef true and false before U_BOOT_CMD. This define and comment > - * shall be removed if change to U_BOOT_CMD is made to take string > - * instead of stringifying it. > - */ > -#define _STDBOOL_H > - > #include > #include > > @@ -143,6 +134,12 @@ U_BOOT_CMD( > "[args..]" > ); > > +/* > + * Undef true and false here to avoid macro expansion by > + */ > +#undef true > +#undef false > + I don't like this. I feel we should not change global files (that build fine for everyone else) to work around problems in one specific implementation. Instead, we should fix the problem at the root cause, for example like that. Could you please test if this patch fixes the problem, too?