[U-Boot] [PATCH] cmd_test: fix a compile error on Blackfin

Masahiro Yamada yamada.m at jp.panasonic.com
Tue Nov 19 08:50:27 CET 2013


Hello Wolfgang


> In message <1384830117-25345-1-git-send-email-yamada.m at 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.

If you think so,  the following also depends on the impilementation
of <stdbool.h>, doesn't it?

#define _STDBOOL_H

#include <common.h>
#include <command.h>


For example, if <stdbool.h> used
_STDBOOL_H_  or  __STDBOOL_H  instead of _STDBOOL_H,
<stdbool.h> would be included and 
common/cmd_test.c  would not be compiled correctly.




> 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?
> 
> 
> From f68e524dd72c9cc08e86b479b82eff59ef6d591b Mon Sep 17 00:00:00 2001
> From: Wolfgang Denk <wd at denx.de>
> Date: Tue, 19 Nov 2013 07:50:46 +0100
> Subject: [PATCH] Blackfin: don't use 'bool' when it causes problems

[snipped]

> @@ -51,7 +51,7 @@ extern u_long get_dclk(void);
>  
>  # define bfin_revid() (bfin_read_CHIPID() >> 28)
>  
> -extern bool bfin_os_log_check(void);
> +extern int bfin_os_log_check(void);
>  extern void bfin_os_log_dump(void);
>  
>  extern void blackfin_icache_flush_range(const void *, const void *);

Yes. Your patch fixed the build error.



Best Regards
Masahiro Yamada



More information about the U-Boot mailing list