build fail on freebsd because of strings.h include
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cuneiform for Linux |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I am maintainer of the freebsd port of smartmontools. While trying to update the port to the latest version i found a lot of build failures. All this failures are looking as:
[ 2%] Building C object cuneiform_
In file included from /usr/include/
/usr/ports/
/usr/ports/
*** Error code 1
The real problem is that wrong strings.h is included from the system string.h header. Reason is very simple - gcc searches all directories from -I/src/... dirs and only then - system path. There is file names strings.h in the source tree, so its included by mistake and this causing a build failure.
There are 2 possible workarounds for this - one is to use mine workaround from the cuneiform_
/* solves conflict with bsd <strings.h> */
#if defined(
#undef __BSD_VISIBLE
#endif
This way it force system strng.h not to include strings.h. The problem is that in many source files <strings.h> is included *before* cuneiform includes, so this will require to change include order of the all such files, Another option (as for me - better one) is to rename strings.h to something like cf_strings.h and also to change references in the cuneiform files (it is used only in 1 or 2 headers). I think this is the best case, because will prevent such problems in the feature. Please tell me your opinion and i will do the patch.
Changed in cuneiform-linux: | |
status: | Fix Committed → Fix Released |
I patched 1.0 and now it builds fine. Proposed patch attached. Also
cuneiform_ src/Kern/ hrstr/strings. h needs to be renamed to cuneiform_ src/Kern/ hrstr/cf_ strings. h and cuneiform_ src/Kern/ hhh/tigerh/ h/strings. h to cuneiform_ src/Kern/ hhh/tigerh/ h/cf_strings. h.