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

Compile error: ignoring attributes on template argument #330

Closed
EllaFeng opened this issue Jan 13, 2018 · 10 comments
Closed

Compile error: ignoring attributes on template argument #330

EllaFeng opened this issue Jan 13, 2018 · 10 comments

Comments

@EllaFeng
Copy link

I try to compile this library with scons command,

scons Werror=1 -j8 debug=0 asserts=1 neon=0 opencl=1 embed_kernels=1 os=linux arch=arm64-v8a build=cross_compile

using aarch64-poky-linux-g++ --version

aarch64-poky-linux-g++ (GCC) 6.2.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

But I got the following error like in OpenCL.h, not sure if this is related to my compiler.
In file included from ./arm_compute/core/CL/CLHelpers.h:27:0,
from src/core/CL/CLHelpers.cpp:24:
./arm_compute/core/CL/OpenCL.h:60:38: error: ignoring attributes on template argument ‘cl_int(cl_program, cl_uint, _cl_device_id* const*, const char*, void ()(cl_program, void), void*) {aka int(_cl_program*, unsigned int, _cl_device_id* const*, const char*, void ()(_cl_program, void*), void*)}’ [-Werror=ignored-attributes]
std::function<decltype(func_name)> func_name##_ptr = nullptr
^
./arm_compute/core/CL/OpenCL.h:62:5: note: in expansion of macro ‘DECLARE_FUNCTION_PTR’
DECLARE_FUNCTION_PTR(clBuildProgram);
^~~~~~~~~~~~~~~~~~~~
./arm_compute/core/CL/OpenCL.h:60:38: error: ignoring attributes on template argument ‘cl_int(cl_command_queue, cl_kernel, cl_uint, const size_t*, const size_t*, const size_t*, cl_uint, _cl_event* const*, _cl_event**) {aka int(_cl_command_queue*, _cl_kernel*, unsigned int, const long unsigned int*, const long unsigned int*, const long unsigned int*, unsigned int, _cl_event* const*, _cl_event**)}’ [-Werror=ignored-attributes]
std::function<decltype(func_name)> func_name##_ptr = nullptr
^
./arm_compute/core/CL/OpenCL.h:63:5: note: in expansion of macro ‘DECLARE_FUNCTION_PTR’
DECLARE_FUNCTION_PTR(clEnqueueNDRangeKernel);
^~~~~~~~~~~~~~~~~~~~
./arm_compute/core/CL/OpenCL.h:60:38: error: ignoring attributes on template argument ‘cl_int(cl_kernel, cl_uint, size_t, const void*) {aka int(_cl_kernel*, unsigned int, long unsigned int, const void*)}’ [-Werror=ignored-attributes]
std::function<decltype(func_name)> func_name##_ptr = nullptr
^
./arm_compute/core/CL/OpenCL.h:64:5: note: in expansion of macro ‘DECLARE_FUNCTION_PTR’

@EllaFeng
Copy link
Author

EllaFeng commented Jan 13, 2018

I used a cross-compiler to 5.4.0, and it worked.
Will this marked as known issue?

@psyhtest
Copy link

I see these warnings all the time with GCC 6.3 and 7.2 (which is why I don’t build with -Werror). I tend to trust these newer GCCs to be right about suspecting that there is something wrong with the code. But what is it?

@AnthonyBarbier
Copy link
Contributor

I'm happy for us to fix this warning if someone can explain to me what it's about :)

I did a quick research and didn't find much explanations out there about this warning.

@psyhtest
Copy link

Ha-ha, me too! (And I am a compiler guy :))

@EllaFeng
Copy link
Author

greatly appreciate your attention. Not sure whether this is bugs in GCC.

@GeorgeARM
Copy link
Contributor

Does it fail when you build with debug=1 ?

@EllaFeng
Copy link
Author

Yes, also failed

@GeorgeARM
Copy link
Contributor

I actually just tried linaro toolchains 6.2, 6.3 and 7.2 and didn't get any warnings.
Thus I checked our project's Sconstruct and saw:

        if version_at_least(compiler_ver, '6.1'):
            env.Append(CXXFLAGS = ['-Wno-ignored-attributes'])

So we disable these.
Can you check if it goes to this path and if not why?

@GeorgeARM
Copy link
Contributor

GeorgeARM commented Jan 13, 2018

I think that these warnings have to do with the attributes on the CL API entrypoints. Because template parameters do not retain the parameter's attributes as they are not part of the name mangling.
Thus we cannot do much for this, just disable the warning (as we do now). Can't think of something else.

@EllaFeng
Copy link
Author

Thanks very much. I will disable these warnings as your suggestion.

aaronj0 added a commit to compiler-research/CppInterOp that referenced this issue Aug 27, 2024
…late parameters warning

This is to suppress a bogus warning(and therefore error) on the CI while migrating to Ubuntu 24. See ARM-software/ComputeLibrary#330
aaronj0 added a commit to compiler-research/CppInterOp that referenced this issue Sep 23, 2024
…late parameters warning

This is to suppress a bogus warning(and therefore error) on the CI while migrating to Ubuntu 24. See ARM-software/ComputeLibrary#330
aaronj0 added a commit to compiler-research/CppInterOp that referenced this issue Oct 21, 2024
…late parameters warning

This is to suppress a bogus warning(and therefore error) on the CI while migrating to Ubuntu 24. See ARM-software/ComputeLibrary#330
mcbarton pushed a commit to compiler-research/CppInterOp that referenced this issue Oct 24, 2024
…late parameters warning

This is to suppress a bogus warning(and therefore error) on the CI while migrating to Ubuntu 24. See ARM-software/ComputeLibrary#330
aaronj0 added a commit to compiler-research/CppInterOp that referenced this issue Oct 24, 2024
…late parameters warning

This is to suppress a bogus warning(and therefore error) on the CI while migrating to Ubuntu 24. See ARM-software/ComputeLibrary#330
mcbarton pushed a commit to compiler-research/CppInterOp that referenced this issue Oct 27, 2024
…late parameters warning

This is to suppress a bogus warning(and therefore error) on the CI while migrating to Ubuntu 24. See ARM-software/ComputeLibrary#330
aaronj0 added a commit to compiler-research/CppInterOp that referenced this issue Oct 30, 2024
…late parameters warning

This is to suppress a bogus warning(and therefore error) on the CI while migrating to Ubuntu 24. See ARM-software/ComputeLibrary#330
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

No branches or pull requests

4 participants