[EMAIL PROTECTED] wrote:
>
> Quoting Xavier Hienne <[EMAIL PROTECTED]>:
>
> > It's really strange that a call to calloc with a 0 argument returns a
> > valid value (i.e. not NULL)... This call corrupts your heap and it makes
> > [cm]alloc segfault some time later during ggiOpen. libc bug ?
>
> No, I should have checked errno value instead of return value...
According to ANSI2 specs, a call to malloc with a 0 size is
implementation defined: "either a null pointer is returned, or the
behavior is as if the size were some nonzero value, except that the
returned pointer shall not be used to access an object". It seems we
have the latter case in glibc and thus checking errno would have been of
no use.
Xavier