Skip to content

Compiling with GCC 15 encountering error: too many arguments to function 'GetRP1Memory' #409

@CC-Hsu

Description

@CC-Hsu

Hi, Team,

I tried to compile wiringpi-3.16 with GCC 15 and encountered the below error.

[Compile] wiringPiSPI.c
wiringPi.c: In function 'wiringPiGlobalMemoryAccess':
wiringPi.c:3363:5: error: too many arguments to function 'GetRP1Memory'; expected 0, have 2
 3363 |     GetRP1Memory(pciemem_RP1, sizeof(pciemem_RP1));
      |     ^~~~~~~~~~~~ ~~~~~~~~~~~
wiringPi.c:3329:6: note: declared here
 3329 | void GetRP1Memory() {
      |      ^~~~~~~~~~~~

But the compilation works if using GCC 14.

I find that the issue might comes from some behavior change on function signature specifies no argument.

It seems that either improve the function to explicitly specify function signatures for wiringPiGlobalMemoryAccess() (and an additional function call change),
or compiling with -std=gnu17 in CFLAGS option in the makefile.

Can WiringPi team help improve the code and release a new version to make the compilation work for newer GCC?
(I prefer to download from tagged / released pages rather than building from the master branch 😅)

Best Regards.

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