I'm collaborating on an opensource project where the global compiler settings include -Werror
and -pedantic
, so in order to have my contributions accepted, I'll have to comply with those.
Second, I'm a Windows person, so I have happily built a new component of this project, only to realize now that it doesn't compile on Linux, throwing the following warning:
style of line directive is a GCC extension
on every single line (on every 3rd char to be specific) of a CUDA (.cu) source file that is part of my component.
I'm using cmake with the FindCUDA.cmake
scripts to compile CUDA. The source file doesn't contain any #line
directive so I'm completely clueless as to what GCC is complaining about.
First I thought it was line-endings, but the Linux "file" command reports the .cu
file as "C source, ASCII text", no "with CRLF line terminators".
The rest of the opensource project doesn't contain any CUDA, so I have nothing to compare with.
What does this warning mean exactly, and how do I get rid of it?