[FFmpeg-cvslog] r11835 - trunk/configure

Rich Felker dalias
Mon Feb 4 04:35:04 CET 2008


On Mon, Feb 04, 2008 at 12:20:17AM +0200, Uoti Urpala wrote:
> On Sun, 2008-02-03 at 22:49 +0100, Michael Niedermayer wrote:
> > On Sun, Feb 03, 2008 at 04:41:43PM -0500, Rich Felker wrote:
> > > On Sun, Feb 03, 2008 at 10:33:26PM +0100, michael wrote:
> > > > Make string constants const. Why is this not default?
> > > 
> > > Because C says string literals have type "char *" and not "const char *"
> > 
> > Thats a pretty good argument, i wonder why the standard says that though?
> 
> Because a strictly standard-conforming C program cannot convert
> const-qualified pointers to non-const-qualified ones, and being unable
> to use "char *" variables with string literals would become very
> annoying.

I'm curious how C makes this condition for conformance consistent with
the rest of the spec. Certainly one can use sprintf and sscanf with %p
to de-qualify any pointer. As long as no write is subsequently
performed through it I can't see how this could yield undefined
behavior..

Regardless, your explanation of why literals have type "char *" is
correct.

Rich




More information about the ffmpeg-cvslog mailing list