Mike Maslenkin [mailto:mike.maslen...@gmail.com] wrote:
]Sent: Saturday, October 24, 2015 04:57 PM ]To: El-Haj-Mahmoud, Samer <samer.el-haj-mahm...@hpe.com> ]Cc: edk2-devel-01 <edk2-de...@ml01.01.org>; Andrew Fish <af...@apple.com> ]Subject: Re: [edk2] [MdeModulePkg] RegularExpressionDxe does not compile with Xcode 6.3.2 ] ]Sorry for the noise, but I can not pass warnings here: ] ]build -p MdeModulePkg/MdeModulePkg.dsc -t GCC48 -a X64: ] ]Build environment: Linux-3.16.7-24-desktop-x86_64-with-SuSE-13.2-x86_64 ]Build start time: 00:20:50, Oct.25 2015 ] ] ]Building ... /home/user/edk2/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf [X64] ]/home/user/edk2/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c: In function ]‘OnigurumaMatch’: ]/home/user/edk2/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c:123:5: error: call to ]function ‘onig_error_code_to_str’ without a real prototype [-Werror=unprototyped-calls] ] onig_error_code_to_str ((OnigUChar *)ErrorMessage, OnigResult, ]&ErrorInfo); ] ^ ]In file included ]from /home/user/edk2/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.h:19:0, ] ]from /home/user/edk2/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c:17: ]/home/user/edk2/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/oniguruma.h:722:5: note: ]‘onig_error_code_to_str’ was declared here ] int onig_error_code_to_str PV_((OnigUChar* s, int err_code, ...)); ] ^ ]/home/user/edk2/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c:147:7: error: call to function ]‘onig_error_code_to_str’ without a real prototype [-Werror=unprototyped-calls] ] onig_error_code_to_str ((OnigUChar *)ErrorMessage, OnigResult); ] ^ ]In file included ]from /home/user/edk2/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.h:19:0, ] ]from /home/user/edk2/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c:17: ]/home/user/edk2/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/oniguruma.h:722:5: note: ]‘onig_error_code_to_str’ was declared here ] int onig_error_code_to_str PV_((OnigUChar* s, int err_code, ...)); ] ^ ]cc1: all warnings being treated as errors ]make: *** ][/home/user/edk2/Build/MdeModule/DEBUG_GCC48/X64/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe/]OUTPUT/RegularExpressionDxe.obj] Error 1 ] ]and this is because of ] ]<<<< RegularExpressionDxe/Oniguruma/oniguruma.h>>>> ] ] #ifdef HAVE_STDARG_PROTOTYPES ] # define PV_(args) args ] #else ]>>>> # define PV_(args) () ] #endif ] #endif ] ]That makes: ] ]<<<< RegularExpressionDxe.i >>>> ] ]int onig_init (void); ]extern ]int onig_error_code_to_str (); ] ] ]Am I missing something? SUSE GCC is built using a patch that adds warning -Wunprototyped-calls, and this patch was never accepted for standard gcc. Some of the developers here test gcc builds on windows using standard gcc, which lacks this warning. That difference might explain why you are the first to encounter this build fail. Some C++ programmers might be surprised to find standard gcc and Microsoft C compilers accepts the following code, even with gcc -Wall -Wextra and CL /W4: int foo (); int bar (void) { return foo (1,2,3); } In C++, the foo prototype means no arguments are allowed. But in C, the foo prototype means any number and type of argument are allowed. This big difference in the interpretation of the missing argument list is because modern C still supports pre-C89 code. The solution to the problem is to add -Wstrict-prototypes to the gcc flag definitions in Conf/tools_def.template. GCC option -Wstrict-prototypes is better suited for edk2 use than -Wunprototyped-calls because edk2 does not support pre-C89 C language. Warning -Wstrict-prototypes will catch more problems than -Wunprototyped-calls. Adding -Wstrict-prototypes will require some function prototype improvements to the edk2 source code. Most of the failing cases -Wstrict-prototypes flags in edk2 are where the developer mistakenly uses prototype foo() where prototype foo(VOID) is needed. Thanks, Scott ]Passing this place I encountered a number of similar issues for other ]library modules. ] ]Looks like OnigurumaUefiPort.h must define HAVE_STDARG_PROTOTYPES. ] ] ]On Thu, 2015-10-22 at 17:16 +0000, El-Haj-Mahmoud, Samer wrote: ]> Reviewed-by: Samer El-Haj-Mahmoud <el...@hpe.com> ]> ]> ]> -----Original Message----- <snip> _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel