Re: questions about gcc options

2005-11-29 Thread Lowell Gilbert
Mamta BANSAL [EMAIL PROTECTED] writes:

 Hello
  for a c code i am using gcc compiler.
 i have doubt using -c option.
 for a c code the code compiles (without error ) with -c option even if
 i don't provide prior declaration of function.
 i mean i have try.c
 //***
 
 void my_func( ){
 call_to_undeclared_func( );
 }
 //
 i do : gcc -c try.c , it works.
 is it the correct behaviour , i mean should it not ask for atleast
 declearation of call_to_undeclared_func( );
 
 like if my make the same as try.cpp then usen use the same command it
 gives the foll. error.:
 
 try.cpp: In function `void my_func()':
 try.cpp:2: implicit declaration of function `int
 call_to_undeclared_func(...)'
 which i feel is expected behaviour.

That doesn't require a diagnostic in C, but it does in C++.

If you want the diagnostics anyway, use the
-Wimplicit-function-declaration flag to the compiler.  Or -Wall, which
adds a pretty extensive set of non-required warnings.  See the gcc
manual if you want more information.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


questions about gcc options

2005-11-27 Thread Mamta BANSAL

Hello
for a c code i am using gcc compiler.
i have doubt using -c option.
for a c code the code compiles (without error ) with -c option even if i 
don't provide prior declaration of function.

i mean i have try.c
//***

void my_func( ){
call_to_undeclared_func( );
}
//
i do : gcc -c try.c , it works.
is it the correct behaviour , i mean should it not ask for atleast 
declearation of call_to_undeclared_func( );


like if my make the same as try.cpp then usen use the same command it 
gives the foll. error.:


try.cpp: In function `void my_func()':
try.cpp:2: implicit declaration of function `int 
call_to_undeclared_func(...)'

which i feel is expected behaviour.

Best Regards
Mamta


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


questions about gcc options

2004-09-04 Thread stheg olloydson
Hello,

I decided to repost this with a less ambiguous subject.



I have  a few questions concerning optimization. I
just setup 5.2.1p9 on an athlon-xp box. I used -fmemoize-lookups and
-fsave-memoized options but I got this when doing a make buildworld:

cc1plus: error: unrecognized command line option -fmemoize-lookups
cc1plus: error: unrecognized command line option -fsave-memoized
*** Error code 1

I checked the gcc 3.3.3 manual for info (because they worked under
3.2.2) and couldn't find any mention of them. Googling took me to
numerous sites that had the same gcc manpage (unknown version) that
said:

-fmemoize-lookups 
-fsave-memoized 
Use heuristics to compile faster. These heuristics are not enabled by
default, since they are only effective for certain input files. Other
input files compile more slowly.

The gcc-1750 support site goes even further and adds:

The code that implements these flags has rotted; you should probably
avoid using them.

OK, that's fine. Does that mean beginning with versions of gcc 3.2.2
(at least) these options are deprecated? I don't find anything about
this in UPDATING, and they still appear in
/usr/share/examples/etc/make.conf

Also, concerning the -mmmx, -m3dnow, and -msse options, I read
somewhere
(bsdforum.org?) that cputype?=athlon-xp implies those three options,
but I couldn't find a mention of it in the gcc 3.3.3 manual (doesn't
mean it's not there). Is this true, or should they be explicit?
Finally, what optimizations are people using on their production 5.2.1
boxen? -mfpmath=sse looks interesting, but is it safe? The manual says:

The resulting code should be considerably faster in the majority of
cases and avoid the numerical instability problems of 387 code, but
may break some existing code that expects temporaries to be 80bit. 
This is the default choice for the x86-64 compiler. 

Not being a c/c++ person, I appreciate any help in the matter.

Regards,

Stheg


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]