All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] cmd_test: fix a compile error on Blackfin
Date: Tue, 19 Nov 2013 08:01:44 +0100	[thread overview]
Message-ID: <20131119070144.70D40380481@gemini.denx.de> (raw)
In-Reply-To: <1384830117-25345-1-git-send-email-yamada.m@jp.panasonic.com>

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 <stdbool.h>.
> 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 <common.h>
>  #include <command.h>
>  
> @@ -143,6 +134,12 @@ U_BOOT_CMD(
>  	"[args..]"
>  );
>  
> +/*
> + * Undef true and false here to avoid macro expansion by <stdbool.h>
> + */
> +#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?

  parent reply	other threads:[~2013-11-19  7:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-19  3:01 [U-Boot] [PATCH] cmd_test: fix a compile error on Blackfin Masahiro Yamada
2013-11-19  3:15 ` Masahiro Yamada
2013-11-19  7:01 ` Wolfgang Denk [this message]
2013-11-19  7:50   ` Masahiro Yamada
2013-11-25  1:43   ` Masahiro Yamada
2013-11-25 13:06     ` Tom Rini
2013-11-25 14:19     ` Wolfgang Denk
2013-11-26 10:34       ` Masahiro Yamada
2013-11-25 21:58   ` [U-Boot] " Tom Rini
2013-11-19 15:51 ` [U-Boot] [PATCH] " Måns Rullgård
2013-11-20  4:29   ` Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131119070144.70D40380481@gemini.denx.de \
    --to=wd@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.