Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
sys-boot/udk-2015 error: ISO C++ forbids comparison between
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Cuong Nguyen
Apprentice
Apprentice


Joined: 18 Jan 2018
Posts: 152

PostPosted: Mon Mar 19, 2018 7:28 am    Post subject: sys-boot/udk-2015 error: ISO C++ forbids comparison between Reply with quote

Hello, have anyone tried emerge sys-boot/refind with TianoCore library instead of default gnuefi?

I've tried building refind with gnu-efi library but my system can't boot to refind boot manager. I manually unzipped refind binary from the author's site https://www.rodsbooks.com/refind/index.html and it works. This binary built with TianoCore library.

So I masked gnu-efi and start building sys-boot/udk-2015 and got the following error:
Code:

VfrUtilityLib.cpp:3287:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   if (mStringFileName == '\0' ) {
                          ^~~~
VfrUtilityLib.cpp:3310:9: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
   fread ((char *)StringPtr, sizeof (UINT8), Length, pInFile);
   ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [<builtin>: VfrUtilityLib.o] Error 1
make[2]: Leaving directory '/var/tmp/portage/sys-boot/udk-2015/work/MyWorkSpace/BaseTools/Source/C/VfrCompile'
make[1]: *** [GNUmakefile:79: VfrCompile] Error 2
make[1]: Leaving directory '/var/tmp/portage/sys-boot/udk-2015/work/MyWorkSpace/BaseTools/Source/C'
make: *** [GNUmakefile:25: Source/C] Error 2
make: Leaving directory '/var/tmp/portage/sys-boot/udk-2015/work/MyWorkSpace/BaseTools'


How to patch this error? I use gcc-7.3.0

Thanks
Back to top
View user's profile Send private message
Irre
Guru
Guru


Joined: 09 Nov 2013
Posts: 434
Location: Stockholm

PostPosted: Mon Mar 19, 2018 8:28 am    Post subject: Reply with quote

Maybe:
Code:
if (strlen(mStringFileName) == 0) {


[Moderator edit: added [code] tags to preserve output layout. -Hu]
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30909
Location: here

PostPosted: Mon Mar 19, 2018 3:29 pm    Post subject: Reply with quote

Probably better solution is create an ebuild for 2017 version
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21629

PostPosted: Tue Mar 20, 2018 1:47 am    Post subject: Reply with quote

Irre wrote:
Maybe:
Code:
if (strlen(mStringFileName) == 0) {


[Moderator edit: added [code] tags to preserve output layout. -Hu]
No. This is an annoyingly common mistake with people who know about strlen, but do not think about how it works. String lengths are not cached. Computing them requires walking the string. If all you want to know is whether the string is empty, test that. Do not count the length of the string just to test if you counted to zero.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Tue Mar 20, 2018 6:20 am    Post subject: Reply with quote

fedeliallalinea wrote:
Probably better solution is create an ebuild for 2017 version

Could you do that for us? See bug 628300
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30909
Location: here

PostPosted: Tue Mar 20, 2018 8:13 am    Post subject: Reply with quote

charles17 wrote:
fedeliallalinea wrote:
Probably better solution is create an ebuild for 2017 version

Could you do that for us? See bug 628300

Unfortunately no, because I do not know the program and with a quick look in 2015 ebuild isn't a trivial package
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum