Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Tcl 9.0 fails to build from source for big-endian architectures

Closed / Fixeda606b0a528ebb1b1ecbe9813d1f5947cca63bbeeCreated 3 years agoUpdated 3 years ago
Descriptionmarkdown2023-11-26 19:05:00

Currently, Tcl 9 fails to build from source on big-endian architecture with the following error messages:

In file included from /<<PKGBUILDDIR>>/generic/tclUtf.c:12:
/<<PKGBUILDDIR>>/generic/tclInt.h:4644:43: error: expected declaration specifiers or ‘...’ before ‘(’ token
 4644 | #   define TclUniCharNcmp(cs,ct,n) memcmp((cs),(ct),(n)*sizeof(Tcl_UniChar))
      |                                           ^
/<<PKGBUILDDIR>>/generic/tclUtf.c:1878:1: note: in expansion of macro ‘TclUniCharNcmp’
 1878 | TclUniCharNcmp(
      | ^~~~~~~~~~~~~~
/<<PKGBUILDDIR>>/generic/tclInt.h:4644:48: error: expected declaration specifiers or ‘...’ before ‘(’ token
 4644 | #   define TclUniCharNcmp(cs,ct,n) memcmp((cs),(ct),(n)*sizeof(Tcl_UniChar))
      |                                                ^
/<<PKGBUILDDIR>>/generic/tclUtf.c:1878:1: note: in expansion of macro ‘TclUniCharNcmp’
 1878 | TclUniCharNcmp(
      | ^~~~~~~~~~~~~~
/<<PKGBUILDDIR>>/generic/tclInt.h:4644:53: error: expected declaration specifiers or ‘...’ before ‘(’ token
 4644 | #   define TclUniCharNcmp(cs,ct,n) memcmp((cs),(ct),(n)*sizeof(Tcl_UniChar))
      |                                                     ^
/<<PKGBUILDDIR>>/generic/tclUtf.c:1878:1: note: in expansion of macro ‘TclUniCharNcmp’
 1878 | TclUniCharNcmp(
      | ^~~~~~~~~~~~~~

(full log can be found at Debian buildd log site)

As far as I can see, the macro definition of TclUniCharNcmp from tclInt.h (line 4644) clashes with the function definition with the same name in tclUtf.c (line 1878). The bug didn't show in Tcl 8.* because they set TCL_UTF_MAX=3 while TCL_UTF_MAX=4 for Tcl 9.

Referenced by2
chrstphrchvzwiki2023-11-26 21:44:53

As already done for other functions with both macro and function implementations, I predict this will be fixed by putting #undef TclUniCharNcmp before the actual function definition in tclUtf.c.

jan.nijtmanswiki2023-11-26 22:29:34

In this case, the macro TclUniCharNcmp() isn't used anywhere, so a better solution is just to remove it completely.

Thanks for the report! Should be fixed now.

Log in (anonymous is fine) to add a comment.