Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address type mismatch warnings on aarch64 #313

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ellert
Copy link
Contributor

@ellert ellert commented Jan 28, 2025

The PROVIDER_INFO macro used in the aarch64 code declares all functions with the signature:

extern void function(void);

The actual return type and parameter list of the functions are however different. The declarations provided by the PROVIDER_INFO macro therfore conflicts with the actual declarations of the functions elsewhere in the code, causing compiler warnings.

This commit drops the PROVIDER_INFO macro and provides proper function declarations, eiter by including a header file or by providing a forward declaration. This corresponds to how the code for the other architectures are handlinging this issue.

This PR fixes: #312

The PROVIDER_INFO macro used in the aarch64 code declares all
functions with the signature:

extern void function(void);

The actual return type and parameter list of the functions are however
different. The declarations provided by the PROVIDER_INFO macro
therfore conflicts with the actual declarations of the functions
elsewhere in the code, causing compiler warnings.

This commit drops the PROVIDER_INFO macro and provides proper function
declarations, eiter by including a header file or by providing a
forward declaration. This corresponds to how the code for the other
architectures are handlinging this issue.

Signed-off-by: Mattias Ellert <[email protected]>
@pablodelara
Copy link
Contributor

@liuqinfei could you take a look at this PR? Thanks!

@pablodelara
Copy link
Contributor

@ellert, China is on holidays until next week I think, so @liuqinfei won't be available until then to review.

@liuqinfei
Copy link
Contributor

Hi, ellert. Thanks for your commit.
Macros such as Provider_INFO enable efficient declaration of functions without redundant lines of code.
You can refer to the implementation of x86. When declaring a extern function, you do not need to use the return value type. And here for aarch64, you can see that DIGNOSTIC_IGNORE(-Wnested-externs) has been explicitly used in the macro definition to ignore specific warning messages releated to extern.
And i compiled isal v2.31.1 on the openEuler 22.03 (LTS-SP3) OS with kunpeng920 platform(aarch64). There is no such warning information.
I don't think such a modification is necessary.

@ellert
Copy link
Contributor Author

ellert commented Feb 11, 2025

There is no such warning information.

Did you try to compile with gcc 15? The problem reported by @pablodelara in #312 and also seen in e.g. this compilation log from the RPM package build on Fedora 42:

https://kojipkgs.fedoraproject.org//packages/isa-l/2.31.1/4.fc42/data/logs/aarch64/build.log

are related to this new compiler version. This is related to that the default C version in this compiler is C23, especially this section of the porting notes is relevant:

https://gcc.gnu.org/gcc-15/porting_to.html#c23-fn-decls-without-parameters

So the error prone behaviour of earlier C versions where a function with an empty parameter list () can take any number of arguments is no longer valid, and an empty parameter list ins now the same as (void), i.e. a function with no arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compilation warnings in ISA-L 2.31.1 on Fedora-aarch64
3 participants