This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: eCos With GCC 3.4.3


Jay Foster wrote:
I am attempting to migrate from GCC 3.2.1 to GCC 3.4.3, and have
a few questions.  I updated my pkgconf/rules.mak file to
bring in the added support for newer GCC versions.  However, I
get many compiler warnings, such as:

    cc1plus: warning: command line option "-Wstrict-prototypes" is valid for
C/ObjC but not for C++

Should an additional CFLAGS "filter" be added to the rules.mak file
for the ACTUAL_CXXFLAGS, like the following?

Index: ecos/packages/pkgconf/rules.mak
===================================================================
RCS file: /home/cvsroot/ecos_root/public/packages/pkgconf/rules.mak,v
retrieving revision 1.2
diff -u -5 -p -r1.2 rules.mak
--- ecos/packages/pkgconf/rules.mak 25 Feb 2005 18:38:27 -0000 1.2
+++ ecos/packages/pkgconf/rules.mak 25 Feb 2005 18:40:32 -0000
@@ -78,11 +78,11 @@ ACTUAL_CFLAGS = $(CFLAGS)
ACTUAL_CFLAGS := $(subst -fno-rtti,,$(ACTUAL_CFLAGS))
ACTUAL_CFLAGS := $(subst -frtti,,$(ACTUAL_CFLAGS))
ACTUAL_CFLAGS := $(subst -Woverloaded-virtual,,$(ACTUAL_CFLAGS))
ACTUAL_CFLAGS := $(subst -fvtable-gc,,$(ACTUAL_CFLAGS))
-ACTUAL_CXXFLAGS = $(CFLAGS)
+ACTUAL_CXXFLAGS = $(subst -Wstrict-prototypes,,$(CFLAGS))
# pattern matching rules to generate a library object from source code
# object filenames are prefixed to avoid name clashes
# a single dependency rule is generated (file extension = ".o.d")
%.o.d : %.c



This change effectively silences most of these warnings. There are a few places that aren't using the rules.mak file that still get the warnings.

I also get several warnings like the following:

    time.inl:157: warning: inlining failed in call to
'cyg_libc_time_year_is_leap': --param inline-unit-growth limit reached

Is this related to the added '-finline-limit-7000' option in rules.mak?
Should it be larger than 7000?  Is this something else entirely?  Does
it matter?  The code seems to compile and work properly.

I can submit a proper patch for rules.mak if this is deemed the right thing
to do.  I just wanted to see if anyone else has already been down this road.

While you're in there...


GNU Make has $(filter-out patternlist,string),
which I think would work nicely for this.

FLAGS_BAD_FOR_C=-fno-rtti -frtti -Woverloaded-virtual -fvtable-gc
FLAGS_BAD_FOR_CXX=-Wstrict-prototypes

ACTUAL_CFLAGS = $(filter-out $(FLAGS_BAD_FOR_C),$(CFLAGS))
ACTUAL_CXXFLAGS = $(filter-out $(FLAGS_BAD_FOR_CXX),$(CFLAGS))

But it's just a matter of taste, I guess...

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]