Solved Question about "header-files"

I only want to know, if I think right, or if I am stand beneath my shoes.
In the last time I see a lot of warnings with clang: redefined variables, macros and so on. Or errors with undefined macros, etc. Is it a problem with "old" source code, did not adapted newer standard c or c++? Or was it never any times other and I don't recognized it?
 
I think it's not adapted to newer standard c and c++.

Because iI compile my programs with g++ on FreeBSD 9.2 and in 11 CURRENT it's the same.

Clang has the same warning on FreeBSD 9.2 and FreeBSD 11. No difference, so iI think include is the same.
 
They are the same.
Often I see they are no include-guards in the programs - wonder about. Or takes clang wrong search paths and so wrong header-files?
 
http://www.freshports.org/Mk/Uses/localbase.mk.

- Use -isystem instead of -I to add ${LOCALBASE}/include to the list of header
search paths

First, this prevents ports which use strict -Werror settings from
build failures in third party headers (real life example is
devel/pructl which uses -Werror -Weverything and fails in libedit
header on actually harmless padding warning).

Second, this prevents ports which install headers from picking up
their own headers from LOCALBASE instead of using ones from WRKDIR,
which leads to any kind of problems when upgrading via ports.

seems I was right.
 
Back
Top