[tex-k] bibtex build issue under macOS: error: implicit declaration of function

Marius Schamschula lists at schamschula.com
Mon Jul 6 02:20:30 CEST 2020


> On Jul 5, 2020, at 3:48 PM, Karl Berry <karl at freefriends.org> wrote:
> Hi Marius,
>    :info:build bibtex.c:6956:36: error: implicit declaration of function 'open_input_with_dirname' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
>    :info:build       auxfile [auxptr ], -1 ) && ! aopeninwithdirname ( auxfile [auxptr ], 
> As far as Akira and I can tell, open_input_with_dirname is declared
> before this call. Specifically, it's declared in web2c/lib/lib.h, which
> is #included by cpascal.h, which is #included at the very top of bibtex.c.
> Maybe there is a different cpascal.h or lib/lib.h on your system that's
> getting wrongly #included? (The -I options should prevent that, but
> maybe they are getting misinterpreted, or, who knows what.)

I just checked. Neither pascal.h or lib/lib/h exist anywhere else on the system.

> Also, if I compile with -Wimplicit-function-declaration using the gcc on
> centos7, there is no warning.

I was using Apple clang version 12.0.0 (clang-1200.0.22.7), a developer beta version.

I just tried gcc 10, but ended up with a duplicate symbol error for autosp,

but I then went with MacPorts clang 9.0.1, and got a clean build.

> It's true that the identifier open_input_with_dirname occurs in the
> #define before the declaration, but that must not matter, because there is
> no expansion of the macro.
> If I run the compiler invocation with -E -dD instead of -c, to get the
> preprocessor output, I see (line numbers at left):
> 9390 #define aopeninwithdirname(f,p,s) open_input_with_dirname (&(f), p, s)
> ..
> 9557 extern boolean open_input_with_dirname (FILE **, int, const char *);
> ..
> 16405 && ! open_input_with_dirname (&(auxfile [auxptr ]), -1, zbibmakecstring((strnumber) (toplevstr)))
> So it is declared before it's used, unless I'm going blind. I'm stuck as
> to why your compiler is complaining ... --best, karl.

My guess is that this issue will reappear in fall, when Xcode 12.0 is released, unless Apple first fixes the underlying issue.

Marius Schamschula

More information about the tex-k mailing list.