-O1 instead of -O2

Stephan Kulow coolo at kde.org
Tue Jan 8 10:08:22 GMT 2002


On Tuesday, 8. January 2002 11:02, W. Tasin wrote:
> Hello Franco,
>
> Franco De Angelis wrote:
> >Hello Walter,
> >
> >>even the --enable-debug switch won't work anymore using your solution.
> >>For your problem with c-projects you also need a special "special.m4.in"
> >
> >Yes you have reason, and yes it works! Now I have lots of warnings
> > again... the -Wall switch is not eaten any more! :-)
>
> Apart from the fact that -Wall is good for preventing memory leaks, so
> it should be inserted (at least while compiling with kdevelop), on my
> system I haven't -Wall activated if I compile the project on command line.
> So please test it by invoking "make clean; make" on the command line.
> Maybe -Wall is only a session flag set by kdevelop.
>
> >OK. So my C project is fixed.
>
> But that's the best method ;-)
>
> >Er... I also have a mixed C and C++ project (created as C++ project
> >with kdevelop). I modified my configure.in like this:
> >
> >	...
> >	AC_CHECK_COMPILERS
> >	CFLAGS="$NOOPT_CFLAGS -O1"
> >	CXXFLAGS="$NOOPT_CXXFLAGS -O1"
> >	...
> >
> >and again, it SEEMS :-) to work.
>
> Unfortunately it only seems to work.
> Inside acinclude.m4.in there is no NOOPT_CFLAGS published, so you have
> the same problem as in a plain c project.
>
> To introduce this flag you have to do the same with like I did in the
> last mail within special.m4.in:
>
> -------
> AC_CHECK_COMPILERS
>
> CXXFLAGS="$NOOPT_CXXFLAGS -O1"
>
> # the following is to allow programs, that are known to
> # have problems when compiled with -O2
> if test -n "$CFLAGS"; then
>       kde_safe_IFS=$IFS
>       IFS=" "
>       NOOPT_CFLAGS=""
>       for i in $CFLAGS; do
>         case $i in
>           -O*)
>                 ;;
>           *)
>                 NOOPT_CFLAGS="$NOOPT_CFLAGS $i"
>                 ;;
>         esac
>       done
>       IFS=$kde_safe_IFS
> fi
>
> AC_SUBST(NOOPT_CFLAGS)
> CFLAGS="$NOOPT_CFLAGS -O1"
>
> -------
>
> >Are there more hidden subtilties, or is it ok?
> >
> >Thank you! :-)
> >Franco
>
> That's it...
> Ciao
>
> Walter
>
> PS: I cc'd this to Coolo:
> Stephan shouldn't this be done inside the AC_CHECK_COMPILERS of
> acinclude.m4.in to have a symmetric handling of CXXFLAGS and CFLAGS?
> Or am I wrong?
We introduced NOOPT_CXXFLAGS as we had some C++ files that had trouble with 
-O2. I don't care for C files that have problems. If you do, then you may 
change that

Greetings, Stephan

-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list