Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: bd18371fefdc6681a4b6dc21c4e5ddbbececdad0fc59f7310f0d9e292923a777
Ticket: 6b0f776c52f9ae7ae9e079e83d31a8c624b22b90
gcc 14 breaks configure test for bigendian leading to broken floating point
User & Date: anonymous on 2025-07-02 18:54:40
Changes

  1. comment changed to:
    I was trying to debug why a GCC 14 build of tcl 8.6.16 broke any use of floating point, for example:
    
    ```
    $ tclsh
    % expr rand()
    wrong digit!
    Abort (core dumped)
    ```
    
    It turned out, after comparing against an earlier GCC 13 build, that the GCC 14 build was incorrectly being built with `-DWORDS_BIGENDIAN=1`, and this is because the configure test for endianness is now broken:
    
    ```
    -conftest.c:54:3: warning: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
    +conftest.c:54:3: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
        54 |   exit (u.c[sizeof (long) - 1] == 1);
           |   ^~~~
    ```
    
    The failure to compile conftest is being interpreted as the _test itself_ failing, thus determining that this x86_64 platform is now suddenly big endian, leading to sub-optimal behaviour.
    
    I'd recommend throwing GCC 14 in the bin for causing such disgustingly insidious fallout, but you may want to implement a more grown-up solution, such as the one I committed to pkgsrc [here](https://github.com/NetBSD/pkgsrc/commit/cf369163c379e6cbdeafd7b0229ca72583d46be8)
    
    Thanks.
    
  2. login: "anonymous"
  3. mimetype: "text/plain"