diff mbox

[U-Boot] zynq: disable -Wstrict-prototypes option for ps7_init.c

Message ID 1401327741-31184-1-git-send-email-yamada.m@jp.panasonic.com
State Superseded
Headers show

Commit Message

Masahiro Yamada May 29, 2014, 1:42 a.m. UTC
The files ps7_init.c and ps7_init.h are supposed to be generated by
hw projects such as Vivado, PlanAhead and then to be copied into
board/xilinx/zynq directory.

But some prototypes in them causes annoying warning messages:

  CC      spl/board/xilinx/zynq/ps7_init.o
In file included from board/xilinx/zynq/ps7_init.c:50:0:
board/xilinx/zynq/ps7_init.h:137:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.h:138:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.h:139:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.h:145:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.c:12602:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.c:12723:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.c:12742:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.c:12761:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.c:12854:6: warning: function declaration isn't a prototype [-Wstrict-prototypes]

The prototypes should be

  int ps7_init(void);
  int ps7_post_config(void);
  int ps7_debug(void);

rather than

  int ps7_init();
  int ps7_post_config();
  int ps7_debug();

We do not want to be bothered because of automatically generated files.
But we cannot touch the external projects for now.
What we can do is to disable -Wstrict-prototypes for ps7_init.c

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Michal Simek <michal.simek@xilinx.com>
---
 board/xilinx/zynq/Makefile | 3 +++
 1 file changed, 3 insertions(+)

Comments

Michal Simek May 29, 2014, 5:07 a.m. UTC | #1
On 05/29/2014 03:42 AM, Masahiro Yamada wrote:
> The files ps7_init.c and ps7_init.h are supposed to be generated by
> hw projects such as Vivado, PlanAhead and then to be copied into
> board/xilinx/zynq directory.
> 
> But some prototypes in them causes annoying warning messages:
> 
>   CC      spl/board/xilinx/zynq/ps7_init.o
> In file included from board/xilinx/zynq/ps7_init.c:50:0:
> board/xilinx/zynq/ps7_init.h:137:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
> board/xilinx/zynq/ps7_init.h:138:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
> board/xilinx/zynq/ps7_init.h:139:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
> board/xilinx/zynq/ps7_init.h:145:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
> board/xilinx/zynq/ps7_init.c:12602:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
> board/xilinx/zynq/ps7_init.c:12723:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
> board/xilinx/zynq/ps7_init.c:12742:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
> board/xilinx/zynq/ps7_init.c:12761:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
> board/xilinx/zynq/ps7_init.c:12854:6: warning: function declaration isn't a prototype [-Wstrict-prototypes]
> 
> The prototypes should be
> 
>   int ps7_init(void);
>   int ps7_post_config(void);
>   int ps7_debug(void);
> 
> rather than
> 
>   int ps7_init();
>   int ps7_post_config();
>   int ps7_debug();
> 
> We do not want to be bothered because of automatically generated files.
> But we cannot touch the external projects for now.
> What we can do is to disable -Wstrict-prototypes for ps7_init.c
> 
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> Cc: Michal Simek <michal.simek@xilinx.com>
> ---
>  board/xilinx/zynq/Makefile | 3 +++
>  1 file changed, 3 insertions(+)

Tested-by: Michal Simek <monstr@monstr.eu>

Thanks,
Michal
diff mbox

Patch

diff --git a/board/xilinx/zynq/Makefile b/board/xilinx/zynq/Makefile
index fd93f63..71c0c35 100644
--- a/board/xilinx/zynq/Makefile
+++ b/board/xilinx/zynq/Makefile
@@ -10,3 +10,6 @@  obj-y	:= board.o
 # Please copy ps7_init.c/h from hw project to this directory
 obj-$(CONFIG_SPL_BUILD) += \
 		$(if $(wildcard $(srctree)/$(src)/ps7_init.c), ps7_init.o)
+
+# Suppress "warning: function declaration isn't a prototype"
+CFLAGS_REMOVE_ps7_init.o := -Wstrict-prototypes