Bug 196460

Summary: Fix sysutils/flashrom compilation with latest clang version
Product: Ports & Packages Reporter: olivier
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed FIXED    
Severity: Affects Some People CC: arved, nukama+maintainer, nukama
Priority: --- Flags: bugzilla: maintainer-feedback? (nukama+maintainer)
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch file for flashrom with latest release of clang none

Description olivier 2015-01-03 11:22:40 UTC
Created attachment 151261 [details]
patch file for flashrom with latest release of clang

sysutils/flashrom compilation failed with latest clang on these errors:

flashrom.c:1741:6: error: comparison of array 'flashchips' equal to a null pointer is always false [-Werror,-Wtautological-pointer-compare]
        if (flashchips == NULL || flashchips[0].vendor == NULL) {
            ^~~~~~~~~~    ~~~~
flashrom.c:1750:6: error: comparison of array 'chipset_enables' equal to a null pointer is always false [-Werror,-Wtautological-pointer-compare]
        if (chipset_enables == NULL) {
            ^~~~~~~~~~~~~~~    ~~~~
flashrom.c:1754:6: error: comparison of array 'board_matches' equal to a null pointer is always false [-Werror,-Wtautological-pointer-compare]
        if (board_matches == NULL) {
            ^~~~~~~~~~~~~    ~~~~
flashrom.c:1758:6: error: comparison of array 'boards_known' equal to a null pointer is always false [-Werror,-Wtautological-pointer-compare]
        if (boards_known == NULL) {
            ^~~~~~~~~~~~    ~~~~
flashrom.c:1762:6: error: comparison of array 'laptops_known' equal to a null pointer is always false [-Werror,-Wtautological-pointer-compare]
        if (laptops_known == NULL) {
            ^~~~~~~~~~~~~    ~~~~
5 errors generated.
Makefile:656: recipe for target 'flashrom.o' failed


I've applied the patch found here for fixing this error:
https://code.google.com/p/chromium/issues/detail?id=347749
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2015-01-03 11:22:40 UTC
Maintainer CC'd
Comment 2 nukama 2015-01-04 14:32:02 UTC
Fixed correctly in upstream >= r1799.

https://code.coreboot.org/p/flashrom/source/commit/1799/

Either apply a patch based on 1799 and test it, 
or wait for the next release in a few weeks (-> closed).
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-02-20 16:48:15 UTC
A commit references this bug:

Author: arved
Date: Fri Feb 20 16:47:30 UTC 2015
New revision: 379447
URL: https://svnweb.freebsd.org/changeset/ports/379447

Log:
  Remove Werror to allow compilation with latest clang

  PR:		196460

Changes:
  head/sysutils/flashrom/Makefile
Comment 4 Tilman Keskinoz freebsd_committer freebsd_triage 2015-02-20 16:49:20 UTC
The upstream patch looks fairly intrusive so i just disabled Werror for now.

Thanks for reporting and getting this fixed upstream.