Hi,
it is Clang that more carefully checks for error.
----------
> VfrSyntax.cpp:56:3: warning: control reaches end of non-void function
-----------
Yes, because the function must return value, for example
------------
INT32 errstd (char *Text)
{
printf ("unrecognized input '%s'\n", Text);
return 0;
}
-------------
Next
---------
> VfrFormPkg.cpp:98:13: error: addition of default argument on redeclaration
> makes this
> constructor a default constructor
> IN UINT32 BufferSize = 4096
---------
Yes, it is rough violation of C++ language. The default value must be in
declaration, in .h file
Here VfrFormPkg.h
----------
public:
CFormPkg (IN UINT32 BufferSize = 4096);
----------
gcc-4.5 seems not see the errors.
Sergey.
On 22.09.2013, at 9:09, "Gao, Liming" <[email protected]> wrote:
> Hi,
> I don’t find such issue on GCC44 and GCC45.
>
> Do you modify BaseTools Compiler option? Or you use the different GCC
> version?
>
> Thanks
> Liming
> From: Sergey Isakov [mailto:[email protected]]
> Sent: Saturday, September 21, 2013 4:49 PM
> To: [email protected]
> Subject: Re: [edk2] BaseTools compilation error
>
> Next
> --------------
> g++ -c -DPCCTS_USE_NAMESPACE_STD -I Pccts/h -I .. -I ../Include/Common -I
> ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I
> ../Include/X64/ VfrSyntax.cpp -o VfrSyntax.o
> VfrSyntax.cpp:56:3: warning: control reaches end of non-void function
> [-Wreturn-type]
> }
> ^
> VfrSyntax.cpp:3543:88: warning: expression result unused [-Wunused-value]
> ...) {zzfailed_pred(" mCompatibleMode",0 /* report */, { 0; /* no user
> action */ } );}
> ^
> Pccts/h/AParser.h:340:44: note: expanded from macro 'zzfailed_pred'
> zzfailed_pred_action(_p,_hasuseraction,_useraction) \
> ^
> Pccts/h/AParser.h:351:27: note: expanded from macro 'zzfailed_pred_action'
> if (_hasuseraction) { _useraction } else { failedSemanticPredicate(_p); }
> ^
> VfrSyntax.cpp:3564:88: warning: expression result unused [-Wunused-value]
> ...) {zzfailed_pred(" mCompatibleMode",0 /* report */, { 0; /* no user
> action */ } );}
> ^
> Pccts/h/AParser.h:340:44: note: expanded from macro 'zzfailed_pred'
> zzfailed_pred_action(_p,_hasuseraction,_useraction) \
> ^
> Pccts/h/AParser.h:351:27: note: expanded from macro 'zzfailed_pred_action'
> if (_hasuseraction) { _useraction } else { failedSemanticPredicate(_p); }
> ^
> 3 warnings generated.
> g++ -I Pccts/h -I .. -I ../Include/Common -I ../Include/ -I
> ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/ -c
> -o VfrFormPkg.o VfrFormPkg.cpp
> VfrFormPkg.cpp:98:13: error: addition of default argument on redeclaration
> makes this
> constructor a default constructor
> IN UINT32 BufferSize = 4096
> ^ ~~~~
> ./VfrFormPkg.h:127:3: note: previous declaration is here
> CFormPkg (IN UINT32 BufferSize);
> ^
> 1 error generated.
> make[1]: *** [VfrFormPkg.o] Error 1
> make: *** [VfrCompile] Error 2
>
> ---------------
>
>
> On 21.09.2013, at 12:43, Sergey Isakov <[email protected]> wrote:
>
>
> In addition, what to do here?
> --------------
> gcc -c -MD -fshort-wchar -fno-strict-aliasing -nostdlib -Wall -Werror -c -g
> -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I
> ../Common/ -I .. -I . -I ../Include/X64/ LzmaCompress.c -o LzmaCompress.o
> LzmaCompress.c:46:48: error: explicitly assigning a variable of type 'void *'
> to itself
> [-Werror,-Wself-assign]
> static void *SzAlloc(void *p, size_t size) { p = p; return MyAlloc(size); }
> ~ ^ ~
> LzmaCompress.c:47:48: error: explicitly assigning a variable of type 'void *'
> to itself
> [-Werror,-Wself-assign]
> static void SzFree(void *p, void *address) { p = p; MyFree(address); }
> ~ ^ ~
> 2 errors generated.
> make[1]: *** [LzmaCompress.o] Error 1
> make: *** [LzmaCompress] Error 2
>
> ---------------
>
> On 21.09.2013, at 12:38, Sergey Isakov <[email protected]> wrote:
>
>
> Dear sirs,
> Please consider
> ---------------------
> make -C GenVtf
> gcc -c -MD -fshort-wchar -fno-strict-aliasing -nostdlib -Wall -Werror -c -g
> -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I
> ../Common/ -I .. -I . -I ../Include/X64/ GenVtf.c -o GenVtf.o
> GenVtf.c:1725:20: error: comparison of unsigned expression >= 0 is always true
> [-Werror,-Wtautological-compare]
> if ((BaseAddress >= 0) && (FwVolSize > 0x40) && ((BaseAddress + FwVolSize)
> % 8 == 0)) {
> ~~~~~~~~~~~ ^ ~
> 1 error generated.
> make[1]: *** [GenVtf.o] Error 1
>
> ----------------------
> May be (BaseAddress != 0) ?
>
> Sergey
> ------------------------------------------------------------------------------
> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13.
> http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk_______________________________________________
> edk2-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/edk2-devel
>
> ------------------------------------------------------------------------------
> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13.
> http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk_______________________________________________
> edk2-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/edk2-devel
>
> ------------------------------------------------------------------------------
> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13.
> http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk_______________________________________________
> edk2-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13.
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel