public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali.rohar@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] CRITICAL error in v2013.04-rc2 (true and false not working)
Date: Thu, 4 Apr 2013 19:46:55 +0200	[thread overview]
Message-ID: <201304041946.55455@pali> (raw)

Hello,

with this version of gcc which is default in ubuntu 12.10:

$ arm-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabi/4.7/lto-wrapper
Target: arm-linux-gnueabi
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.7.2-1ubuntu1' --with-
bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-
suffix=-4.7 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-
threads=posix --with-gxx-include-dir=/usr/arm-linux-gnueabi/include/c++/4.7.2 --libdir=/usr/lib --enable-nls --enable-
clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --enable-plugin 
--enable-objc-gc --enable-multilib --disable-sjlj-exceptions --with-arch=armv5t --with-float=soft --disable-werror --enable-
checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=arm-linux-gnueabi --program-prefix=arm-linux-
gnueabi- --includedir=/usr/arm-linux-gnueabi/include --with-headers=/usr/arm-linux-gnueabi/include --with-libs=/usr/arm-linux-
gnueabi/lib
Thread model: posix
gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-1ubuntu1)

u-boot "true" and "false" hush commands are copiled incorrectly in uboot v2013.04-rc2 
(c8142633e169665b246352918df5b76fd243bb71)

when I run help in u-boot it show:

# help
0       - do nothing, unsuccessfully
1       - do nothing, successfully
?       - alias for 'help'
base    - print or set address offset
...

Instead "0" and "1" there should be "false" and "true" command.

This happen when stdbool.h from C99 compiler is included in cmd_test.c and then true and false macros are expanded to 1 and 
0. Quick fix for this is adding #undef before U_BOOT_CMD:

diff --git a/common/cmd_test.c b/common/cmd_test.c
index d4ec186..a7ec8ac 100644
--- a/common/cmd_test.c
+++ b/common/cmd_test.c
@@ -155,6 +155,7 @@ static int do_false(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	return 1;
 }
 
+#undef false
 U_BOOT_CMD(
 	false,	CONFIG_SYS_MAXARGS,	1,	do_false,
 	"do nothing, unsuccessfully",
@@ -166,6 +167,7 @@ static int do_true(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	return 0;
 }
 
+#undef true
 U_BOOT_CMD(
 	true,	CONFIG_SYS_MAXARGS,	1,	do_true,
 	"do nothing, successfully",

Without above patch and with gcc 4.7.2 it is not possible to use u-boot on Nokia RX-51, becuase it has true and false commands 
in preboot env.

Please fix this problem in u-boot v2013.04.

-- 
Pali Roh?r
pali.rohar at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130404/db5ec94e/attachment.pgp>

             reply	other threads:[~2013-04-04 17:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-04 17:46 Pali Rohár [this message]
2013-04-04 20:33 ` [U-Boot] [PATCH] CRITICAL error in v2013.04-rc2 (true and false not working) Wolfgang Denk
2013-04-04 20:34   ` York Sun
2013-04-04 21:05   ` York Sun
2013-04-04 21:19     ` Pali Rohár
2013-04-04 21:21       ` York Sun
2013-04-04 21:26         ` Pali Rohár
2013-04-04 21:31           ` York Sun
2013-04-04 21:50             ` Wolfgang Denk
2013-04-04 21:58               ` York Sun
2013-04-04 21:47         ` Wolfgang Denk
2013-04-04 21:48           ` York Sun
2013-04-04 21:37     ` Tom Rini

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=201304041946.55455@pali \
    --to=pali.rohar@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox