-O1 instead of -O2

W. Tasin tasin at fhm.edu
Tue Jan 8 10:02:31 GMT 2002


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?

-- 
The KDevelop project: tasin at kdevelop.de [www.kdevelop.org]
--
oohhh sveglia.... il mondo e' ammalato, ma x colpa di chi.........
(Zucchero)
:-------W. Tasin, FB 04,FHM-------------------PGP-KeyID:0x7961A645----------:
<Key-Fingerprint: 1610 835F 0080 32F4 6140  6CF7 A7D0 44CD 7961A645>




-
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