[MPlayer-cvslog] r27240 - trunk/configure

Michael Niedermayer michaelni at gmx.at
Tue Jul 15 01:39:10 CEST 2008


On Tue, Jul 15, 2008 at 12:43:46AM +0200, Diego Biurrun wrote:
[...]
> > > This change
> > > already helped find and fix some non-C99 constructs in FFmpeg.  If you
> > > want to see -std=c99 used, then make FFmpeg compilable with that flag,
> > > which is a prerequisite for MPlayer to use it.
> > 
> > I did not suggest --std=c99 to be used. I just said that there are many
> > solutions and --std=gnu99 is the worst. And not what we want at all ...
> > What iam saying all along is that the standard way to enable various C99 
> > prototypes in the headers is
> > -D_ISOC99_SOURCE or -D_XOPEN_SOURCE=600 or _POSIX_C_SOURCE
> > 
> > These are documented for that purpose in the man pages as shown by reimar
> > and you can look at the official POSIX standard for example at
> > www.opengroup.org. It as well mentions these defines.
> > 
> > What -std=gnu99 enables is nowhere clearly defined. Its not mentioned in any
> > standard document. The assumtation that gnu99 would enable exactly what
> > we want to use and nothing we do not want to use due to portability issues
> > is ridiculous.
> > Its clear gnu99 enabled one of the #defines mentioned above otherwise the
> > missing prototypes would not be there as they are protected by #ifdefs
> > Its also clear it enabled -fasm.
> > What else does it enable? Do we want all of it?
> 
> silver:/tmp $ gcc -std=gnu89 -E -dM -x c /dev/null > gnu89
> silver:/tmp $ gcc -std=gnu99 -E -dM -x c /dev/null > gnu99
> silver:/tmp $ diff -u gnu89 gnu99 
> --- gnu89       2008-07-15 00:14:31.000000000 +0200
> +++ gnu99       2008-07-15 00:14:37.000000000 +0200
> @@ -53,6 +53,7 @@
>  #define __FLT_HAS_INFINITY__ 1
> +#define __STDC_VERSION__ 199901L
>  #define linux 1
> 
> Is that so scary?

no, the question is why do you add gnu99 which is
not defined at all instead of adding -D__STDC_VERSION__=199901L or
_ISOC99_SOURCE ?

The later does exactly what we want, the first does something that
may or may not be what we want.


> 
> silver:/tmp $ gcc -std=c99 -E -dM -x c /dev/null > c99
> silver:/tmp $ diff -u c99 gnu99 
> --- c99 2008-07-15 00:38:43.000000000 +0200
> +++ gnu99       2008-07-15 00:14:37.000000000 +0200
> @@ -29,7 +29,6 @@
>  #define __DBL_HAS_INFINITY__ 1
> -#define __STRICT_ANSI__ 1
>  #define __DBL_MAX_EXP__ 1024
> @@ -41,7 +40,9 @@
>  #define __i386 1
> +#define i386 1
>  #define __i486__ 1
> +#define unix 1
>  #define __i386__ 1
> @@ -53,6 +54,7 @@
>  #define __STDC_VERSION__ 199901L
> +#define linux 1
>  #define __LDBL_MANT_DIG__ 64
> 
> Is that so scary?

yes, some of these defines have very far reaching effects on what they
enable. Besides this does only show a small fraction of the true changes
you can explicitly override these #defines still things like -fasm would
differ.



> 
> > Why do we not just enable one of the defines directly like the standards
> > recommand??? This would work with any compiler.
> > --std=gnu99 will only work with gnu compatible compilers. 
> 
> I have only enabled this for gcc, as the diff clearly showed.

You really dont understand what i and reimar said.
-D_ISOC99_SOURCE is MANDATORY for glibc when you want to use c99 features.
--std=gnu99 does add something similar but ONLY when its used and that is only
with gcc.
Other compilers still need -D_ISOC99_SOURCE with glibc. And strictly you need
-D_ISOC99_SOURCE even with gcc if you would follow what the docs say.

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The worst form of inequality is to try to make unequal things equal.
-- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-cvslog/attachments/20080715/dc8ff27c/attachment.pgp>


More information about the MPlayer-cvslog mailing list