Menu

#408 Build failure due to implicit declaration of functions

Unknown
closed-fixed
nobody
None
v4.6
5
2026-04-08
2020-11-23
No

Hi, joe 4.6 fails to build with Xcode 12 on macOS due to implicit declaration of functions (which have not been allowed ever since C99 but which now in Xcode 12 have been changed from a warning to an actual error).

This was reported to MacPorts here: https://trac.macports.org/ticket/61627

First there are three places where the configure script uses the exit function without including the header that defines exit, causing three errors in the config.log:

conftest.c:56:2: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:65:3: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:145:2: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]

This doesn't cause configuration to abort but causes the results of those three configure tests to be wrong so they should be fixed. The simplest fix is to replace exit with return. If for some reason you prefer to use exit, add #include <stdlib.h> to each test.

Then the build actually fails later with:

tty.c:975:6: error: implicit declaration of function 'openpty' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
tty.c:1221:6: error: implicit declaration of function 'login_tty' is invalid in C99 [-Werror,-Wimplicit-function-declaration]

On macOS this was fixed by adding #include <util.h> to the file. Not sure whether those are in different files on different operating systems.

The full fix I applied to MacPorts is:

https://github.com/macports/macports-ports/blob/4d2c701809a3f9cfce11061571074a66ee3180c5/editors/joe/files/implicit.patch

Discussion

  • John J. Jordan

    John J. Jordan - 2024-02-06

    This was fixed in Mercurial and in the new git repo with this commit

     
  • John J. Jordan

    John J. Jordan - 2024-02-06
    • status: open --> closed-fixed
     
  • Thierry Moisan

    Thierry Moisan - 2024-03-04

    This is not yet fixed since #include <util.h> is not imported on mac.

     
  • John J. Jordan

    John J. Jordan - 2024-03-05
    • status: closed-fixed --> open
     
  • John J. Jordan

    John J. Jordan - 2024-03-05

    Reopening in that case.

     
  • Joe Allen

    Joe Allen - 2026-03-12

    This should now be fixed in the github repo. Need someone with MAC OS to verify it.

     
  • John J. Jordan

    John J. Jordan - 2026-03-12

    I can confirm this compiles properly on my macbook with Sequoia 15.7.4.

     
  • Joe Allen

    Joe Allen - 2026-04-08
    • status: open --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB