OMNeT++/OMNEST Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000528OMNeT++IDE / otherpublic2012-01-20 09:542017-03-02 16:00
Assigned Torhornig 
PlatformOSOS Version
Product Version4.2.1 
Target VersionFixed in Version5.1 
Summary0000528: Please use -isystem instead of -I as include flag for common or system includes
DescriptionIt would be nice if the Makefile variable:

# C++ include paths (with -I)
INCLUDE_PATH = -I/tools/boost/include/boost-1_49 -I.

could be changed into

# C++ include paths (with -I)
INCLUDE_PATH = -isystem /tools/boost/include/boost-1_49 -I.

which means all additional include pathes from C/C++ should use -isystem, which prevents gcc to reports warnings found there.

The same for:


which should be:


Currently I use this workaround in makefraq:

COPTS := $(subst -isystem .,-I.,$(subst -I,-isystem ,$(COPTS)))

which you can use to prevent corrections for the msg-file tool.

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
michael (reporter)
2012-01-20 12:28

Following code can be used after makefraq include to replace -I includes which does not belong to current project (it also replaces -I's for referenced projects), for the window case it is a little bit complicated ;):

# use -isystem instead of -I flag, to hide warnings in these files
RELPRJDOTS = $(subst o,,$(subst o ,/,$(patsubst %,..o,$(subst /, ,$(PROJECTRELATIVE_PATH)))))
ifneq (,$(findstring MINGW,$(shell uname -s)))
    # on windows we need this hack for pathes like -Id:/...
    override COPTS := $(shell echo '$(subst -I$(RELPRJDOTS)/.,-isystem $(RELPRJDOTS)/.,$(COPTS))' |sed -e 's/-I\($(subst \| ,\|,$(addsuffix \|,$(filter %:,$(subst :,: ,$(patsubst -I%,%,$(COPTS))))) \/)\)/-isystem \1/g')
    # on unix we can use this
    override COPTS := $(subst -I/,-isystem /,$(subst -I$(RELPRJDOTS)/.,-isystem $(RELPRJDOTS)/.,$(COPTS)))
$(info Replaced COPTS -I directives with -isystem directive: $(COPTS))
rhornig (administrator)
2017-03-02 16:00

omnetpp.h is now marked as a system header so this is no longer needed. Still you can add a -isystem and specify a folder and it will take precedence over the -I flag.

- Issue History
Date Modified Username Field Change
2012-01-20 09:54 michael New Issue
2012-01-20 12:28 michael Note Added: 0000699
2017-03-02 16:00 rhornig Note Added: 0001341
2017-03-02 16:00 rhornig Status new => resolved
2017-03-02 16:00 rhornig Fixed in Version => 5.1
2017-03-02 16:00 rhornig Resolution open => fixed
2017-03-02 16:00 rhornig Assigned To => rhornig

Copyright © 2000 - 2022 MantisBT Team
Powered by Mantis Bugtracker