clearlinux / cve-check-tool

Original Automated CVE Checking Tool
GNU General Public License v2.0
205 stars 78 forks source link

Compile issues for 5.6.2 release version with all warnings being treated as errors #37

Closed ereshetova closed 8 years ago

ereshetova commented 8 years ago

5.6.2 release compile output:

| ../../cve-check-tool-5.6.2/src/main.c: In function 'main': | ../../cve-check-tool-5.6.2/src/main.c:472:9: error: missing braces around initializer [-Werror=missing-braces] | CveToolInstance instance = { 0 }; | ^ | ../../cve-check-tool-5.6.2/src/main.c:472:9: error: (near initialization for 'instance.shared') [-Werror=missing-braces] | ../../cve-check-tool-5.6.2/src/main.c:472:9: error: missing initializer for field 'pkg_plugin' of 'CveToolInstance' [-Werror=missing-field-initializers] | ../../cve-check-tool-5.6.2/src/main.c:40:20: note: 'pkg_plugin' declared here | CvePlugin _pkgplugin; /<Our current plugin / | ^ | cc1: all warnings being treated as errors | make[3]: ** [cve_check_tool-main.o] Error 1 | make[3]: *\ Waiting for unfinished jobs....

ikeydoherty commented 8 years ago

What's the host GCC version? We saw this only a couple of days ago on GCC 4.8 series

ereshetova commented 8 years ago

gcc 4.8.4. Updated last week to whatever Ubuntu supplies by default.

ikeydoherty commented 8 years ago

Highly infamous bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119

Apparently Clang suffers the same short-sightedness. I'll see if I can fix this with Clang as I don't have such an old GCC on hand.

ikeydoherty commented 8 years ago

From Clang:

main.c:472:40: error: missing field 'hide_patched' initializer
      [-Werror,-Wmissing-field-initializers]
        CveToolInstance instance = { 0 };
                                       ^
main.c:472:38: error: suggest braces around initialization of subobject
      [-Werror,-Wmissing-braces]
        CveToolInstance instance = { 0 };
                                     ^
                                     {}
main.c:472:40: error: missing field 'pkg_plugin' initializer
      [-Werror,-Wmissing-field-initializers]
        CveToolInstance instance = { 0 };

So, light at the end of the tunnel, I can fix it from my system

ikeydoherty commented 8 years ago

^ That patch should fix the issues, if this is just a local install would you be willing to take from git and check that this fixes it please ? :)

ereshetova commented 8 years ago

It isn't local install, but I can modify the recipe to fetch the revision at commit.

ereshetova commented 8 years ago

Yes, works now fine. Thank you very much!

ikeydoherty commented 8 years ago

Awesome, awesome :D I'm working on your other issue now =)