[FFmpeg-cvslog] r12620 - trunk/configure
İsmail Dönmez
ismail
Sat Mar 29 21:09:22 CET 2008
On Sat, Mar 29, 2008 at 10:02 PM, matthieu castet
<castet.matthieu at free.fr> wrote:
>
> ?smail D?nmez wrote:
> > On Fri, Mar 28, 2008 at 10:04 PM, matthieu castet
> > <castet.matthieu at free.fr> wrote:
> >> diego wrote:
> >> > Author: diego
> >> > Date: Fri Mar 28 12:53:37 2008
> >> > New Revision: 12620
> >> >
> >> > Log:
> >> > Replace hackish CFLAGS 64 bit test by a proper compilation check.
> >> > patch by ?smail D?nmez, ismail namtrac org
> >> >
> >> >
> >> > Modified:
> >> > trunk/configure
> >> >
> >> > Modified: trunk/configure
> >> > ==============================================================================
> >>
> >>> + check_cc <<EOF && enable fast_64bit && arch="x86_64"
> >> > + int test[sizeof(char*) - 7];
> >> > +EOF
> >> Just for info gcc see "sizeof(char*) - 7" as a big integer not a
> >> negative integer.
> >>
> >> The check still failed on 32 bits because of array overflow. I wonder if
> >> it was the expected behaviour.
> >
> > Yes thats the point, it won't compile on 32bit. Thats why we use check_cc.
> my point was is there something in C standard that prevent to allocate
> such big array ?
>
> Yes gcc failed because of array overflow, but not all C compiler are gcc.
>
> May be it could be more safe to make "sizeof(char*) - 7" signed and be
> in the case of negative array (which is in the C standard).
sizeof(char*) is 4 on 32bit so you are trying to do int test[-3] which
should fail on all valid compilers.
Regards,
ismail
--
Never learn by your mistakes, if you do you may never dare to try again.
More information about the ffmpeg-cvslog
mailing list