Re: M_PI not being found in math.h with gtk



On Thu, Feb 01, 2007 at 05:54:38PM -0500, zentara wrote:
> 
> I've been using this little shell script to compile and it causes the failure
> because it has the -ansi option. I've been using it so long in my normal
> c I never questioned it.  

-ansi causes certain extensions to become unavailable (see
gcc manual) and defines macro __STRICT_ANSI__ that standard
headers may (and do) detect and avoid declarations and macro
definitions not specified by ANSI C.  M_PI is required by
4.4BSD and Unix98, but not by ANSI C, therefore it is not
defined with -ansi.

If you use Gtk+, you should replace M_PI with G_PI for
portability anyway.  Some implementations (IIRC Microsoft)
do not define M_PI at all.

Yeti


--
Whatever.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]