On Jul 27, 2000, Paul Eggert <[EMAIL PROTECTED]> wrote:

>    From: Alexandre Oliva <[EMAIL PROTECTED]>

>    Even though C99 requires prototypes, older releases of the C
>    Standard don't, and we can't modify autoconf in a way that makes it
>    unusable for such environments.

> But the proposed changes don't make autoconf unusable for pre-C99.

Not unusable, but it will certainly break some code.  Think, for
example, of programs that test for something like malloc(), on a
system in which malloc is declared in some weird header.  They won't
find it, probably replace it, and then all the hell may break loose
because malloc() can't be replaced in that platform.  I'd rather keep
the semantics of performing a linker-only test if this is at all
possible.  Maybe I misunderstood something?

> The C standard has always required that an include file must declare
> each function, even those returning `int'.

But we all know this hasn't always been true :-)

>    We could then have an additional argument, in AC_CHECK_FUNC, if not
>    in AC_CHECK_FUNCS, that would provide fallback declarations of
>    functions whose declarations are missing.

> But the fallback declarations may disagree with the actual signature
> of those functions.

That's why they'd only be used if the test that assumes a prototype
fails, and the linker test would still be done anyway.  But I
understand there's still room for conflicts.  I'm just unsure whether
assuming the function is not present is any better than getting the
wrong prototype.  Both cases may fail badly, and we know one of them
has been working reasonably well, so I'm unwary with the proposal of
changing it.

> Here's an example of why the current AC_CHECK_FUNC is a problem: RCS
> 5.6.7.4 caused the HP-UX 8.07 OS to crash!

I should have read this before writing my previous sentence :-)

>    As a side effect, AC_CHECK_FUNC would now implicitly perform the
>    AC_CHECK_DECL test for functions.

> Something like that might work, but it is complicated.

We'd at least give the developer the option of deciding whether to use
a function even though a declaration isn't available.  Instead, you're
proposing that we decide for the user that it's better.  I, as a
developer, would prefer to have the choice.

> With the proposed change to AC_CHECK_FUNC, we can remove
> AC_CHECK_DECL, as it's not needed.

In either case.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

Reply via email to