Skip to content

Install issues with gcc-14.1 #169

Description

@codedump

Hello,

pip install will bug out with the following error for me:

   [...]
gcc -fno-strict-overflow -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -fexceptions -fcf-protection -fexceptions -fcf-protection -fexceptions │
-fcf-protection -fPIC -D_GNU_SOURCE -D_DEFAULT_SOURCE -Dlinux -DUNIX -D_GLIBCXX_USE_CXX11_ABI=1 -I/tmp/pip-build-env-03ykrg0g/overlay/lib64/python3.12/site-pa│
ckages/epicscorelibs/include -Isoftioc/iocStats/devIocStats -Isoftioc/iocStats/devIocStats/os/Linux -Isoftioc/iocStats/devIocStats/os/default -I/usr/include/p│
ython3.12 -c softioc/iocStats/devIocStats/devIocStatsSub.c -o build/temp.linux-x86_64-cpython-312/softioc/iocStats/devIocStats/devIocStatsSub.o -g0 -std=c99  │
      softioc/iocStats/devIocStats/devIocStatsSub.c: In function ‘scanMonInit’:                                                                               │
      softioc/iocStats/devIocStats/devIocStatsSub.c:91:16: error: implicit declaration of function ‘malloc’ [-Wimplicit-function-declaration]                 │
         91 |   psub->dpvt = malloc(sizeof(epicsTimeStamp));                                                                                                  │
            |                ^~~~~~                                                                                                                           │
      softioc/iocStats/devIocStats/devIocStatsSub.c:26:1: note: include ‘<stdlib.h>’ or provide a declaration of ‘malloc’                                     │
         25 | #include "devIocStats.h"                                                                                                                        │
        +++ |+#include <stdlib.h>                                                                                                                             │
         26 |                                                                                                                                                 │
      softioc/iocStats/devIocStats/devIocStatsSub.c:91:16: warning: incompatible implicit declaration of built-in function ‘malloc’ [-Wbuiltin-declaration-mis│
match]                                                                                                                                                        │
         91 |   psub->dpvt = malloc(sizeof(epicsTimeStamp));                                                                                                  │
            |                ^~~~~~                                                                                                                           │
      softioc/iocStats/devIocStats/devIocStatsSub.c:91:16: note: include ‘<stdlib.h>’ or provide a declaration of ‘malloc’                                    │
      error: command '/usr/bin/gcc' failed with exit code 1

Essentially, gcc is right: there's no <stdlib.h> in devIocStatsSub.c. I'm guessing it's a 14 year old upstream error of EPICS.

I don't know why it used to work until now, but it might have something to do with the fact that it's a gcc 14.1 environment?... Maybe something changed in the way the standard prototype is being interpreted (which I belive is int malloc(), with () generally meaning "no arguments", but also being a valid replacement for "(...)" in the past -- maybe not anymore?)

Or it's because of Python 3.12.4, the one I'm using?

I'm running this on what most likely amounts to a clean install of Fedora 40. (Technically, it's a freshly created "Toolbox" on a recent "Fedora CoreOS"...) Here is the complete script to reproduce:

toolbox create
toolbox enter
sudo dnf install python3-pip python3-devel
sudo dnf group install "C Development Tools and Libraries"
pip install softioc

Cheers,
F.

Activity

  1. codedump commented on Jul 23, 2024

    @codedump
    Author

    I can confirm that it works as intended with an overall older OS version (e.g. toolbox create --release 39, which will recreate an environment representing a past Fedora version).

    It really is something about the new set of tools.

  2. codedump commented on Jul 23, 2024

    @codedump
    Author

    Ah. Got it: Handling of implicit function declarations, new in GCC-14:

    It is no longer possible to call a function that has not been declared. [...]

    I guess this means either a lot of code fixing, or sticking to GCC <= 13 for another decade or so... 🤦

  3. Araneidae commented on Jul 23, 2024

    @Araneidae
    Collaborator

    This is a bit of a pain because devIocStats is an external dependency, so fixing this is not as simple as fixing our code. It's probably worth raising an issue with devIocStats and cross-linking here. Presumably you can check that this is the only error by adding the appropriate #include to your local checkout and checking that building then works.

    I suppose we could do some kind of patch to the checked out dependency before building it?

    The preferred fix is probably to implement #106.

  4. mdavidsaver commented on Jan 8, 2026

    @mdavidsaver
    Contributor

    pythonSoftIOC fails to build on Debian 13 (py3.13, GCC 14.2) due to this issue. The present bundled iocStats version (epics-modules/iocStats@4df9e87) is 6+ years old. The latest iocStats (epics-modules/iocStats@078205e) builds correctly for me.

  5. mdavidsaver commented on Jan 10, 2026

    @mdavidsaver
    Contributor

    My initial diagnosis was incorrect. There is a straightforward issue with the bundling process. iocStats/devIocStats/os/posix/devIocStatsOSD.h includes stdlib.h. However, os/posix/ is not being included in sdist, so instead the default devIocStatsOSD.h in found, which does not include stdlib.h. #199 fixes this, and also updates the bundled iocStats.

  6. AlexanderWells-diamond commented on Jan 12, 2026

    @AlexanderWells-diamond
    Collaborator

    #199 has been merged, closing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions