All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Måns Rullgård" <mans@mansr.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] cmd_test: fix a compile error on Blackfin
Date: Tue, 19 Nov 2013 15:51:42 +0000	[thread overview]
Message-ID: <yw1x61ros835.fsf@unicorn.mansr.com> (raw)
In-Reply-To: <1384830117-25345-1-git-send-email-yamada.m@jp.panasonic.com> (Masahiro Yamada's message of "Tue, 19 Nov 2013 12:01:57 +0900")

Masahiro Yamada <yamada.m@jp.panasonic.com> writes:

> 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.
>
> Blackfin header file
> arch/blackfin/include/asm/blackfin_local.h
> uses bool type here:
>   extern bool bfin_os_log_check(void);
>
> This means Blackfin boards which define CONFIG_SYS_HUSH_PARSER
> always failed in compiling.
>
> This commit fixes this issue by undefining true and false macro.

[...]

> +/*
> + * Undef true and false here to avoid macro expansion by <stdbool.h>
> + */
> +#undef true
> +#undef false

This won't work if stdbool.h defines true/false as an enum.  Some
versions of gcc did this.  The correct fix is to change the code so it
doesn't use any of the identifiers bool, true, or false for other
purposes than those intended by stdbool.h.

I agree with Wolfgang that using "boolean" types is generally a bad idea
that only introduces problems.

-- 
M?ns Rullg?rd
mans at mansr.com

  parent reply	other threads:[~2013-11-19 15:51 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
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 ` Måns Rullgård [this message]
2013-11-20  4:29   ` [U-Boot] [PATCH] " 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=yw1x61ros835.fsf@unicorn.mansr.com \
    --to=mans@mansr.com \
    --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.