Page MenuHomeFreeBSD

Use -isystem for including /usr/local/include
ClosedPublic

Authored by AMDmi3 on Sep 10 2015, 1:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 13, 3:23 AM
Unknown Object (File)
Sun, Oct 12, 1:52 AM
Unknown Object (File)
Sat, Oct 11, 10:57 PM
Unknown Object (File)
Sat, Oct 11, 10:20 PM
Unknown Object (File)
Sat, Oct 11, 10:08 PM
Unknown Object (File)
Wed, Sep 24, 5:54 PM
Unknown Object (File)
Sun, Sep 21, 8:56 AM
Unknown Object (File)
Sep 5 2025, 11:27 PM
Subscribers

Details

Summary

This makes software with strict Werror settings not fail on system includes. Example is devel/pructl which fails with -Werror -Weverything in histedit.h after adding USES=libedit.

/usr/local/include/histedit.h:41:9: error: macro name is a reserved identifier [-Werror,-Wreserved-id-macro]
#define _HISTEDIT_H_
        ^

and

/usr/local/include/histedit.h:191:14: error: padding struct 'struct HistEvent' with 4 bytes to align 'str' [-Werror,-Wpadded]
        const char      *str;
                         ^

Which is even more important, this flag should fix cases when a library is conflicting with it's own headers from the system. E.g. when libfoo is built and it has -I/usr/local/include -I. (in that order), it may pick up /usr/local/include/foo.h from it's previous version and break/miscompile. -isystem works in such a way than even if the same path is included with -I, it's still treated as system, regardless of argument ordering, so this is a reliable solution.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

AMDmi3 retitled this revision from to Use -isystem for including /usr/local/include This makes software with strict Werror settings not fail on system includes. Example is devel/pructl which fails with -Werror -Weverything in histedit.h: ``` /usr/local/include/histedit.h:41:9: error....
AMDmi3 updated this object.
AMDmi3 edited the test plan for this revision. (Show Details)
AMDmi3 edited edge metadata.
AMDmi3 retitled this revision from Use -isystem for including /usr/local/include This makes software with strict Werror settings not fail on system includes. Example is devel/pructl which fails with -Werror -Weverything in histedit.h: ``` /usr/local/include/histedit.h:41:9: error... to Use -isystem for including /usr/local/include.
bapt edited edge metadata.

This is a good improvement we should have done before.

Please open a PR with a link to that review so we can have an exp-run on this except if you are 100% sure to have tested all consumers of this USES.

This revision is now accepted and ready to land.Sep 11 2015, 11:46 PM
In D3618#75098, @bapt wrote:

Please open a PR with a link to that review so we can have an exp-run on this except if you are 100% sure to have tested all consumers of this USES.

It would definitely be safer to have an exp-run.
PR: ports/203101

Nice! @bapt previously scared me off with "it would break any effort on crossbuilding".

In D3618#75826, @jbeich wrote:

Nice! @bapt previously scared me off with "it would break any effort on crossbuilding".

Yes but, since I fixed up my mind and figured out actually both can play together nicely! (sorry back in the time I could not make my mind in the right order)