gcc - "warning: invalid format string conversion" [printf-like-function] only in a CUDA source file -


using ' format specifier in printf-like-function leads warning.

class logcontroller {     auto __attribute__((format(printf, 2, 3)))          insertlogentry( const char * formatstring, ... ) -> void; }  ... logcontroller lc; lc.insertlogentry( "some data %'d", int_value );   // warning in .cu file                                                    // in .cpp file ok 

i have feeling nvcc issue , way avoid warning move 1 line foo.insertlogentry() .cpp file.

even in .cu file host , not device function. idea how rid of warning?

update:

the ' according site extension supported on posix.1-2008-conforming systems. question if cudafe have support or not, underlying compiler gcc 4.9.3?

update:

as talonmies suggested use --dryrun, causes warning:

cudafe --allow_managed --m64 --gnu_version=40903 --c++11 -tused --no_remove_unneeded_entities --debug_mode --gen_c_file_name "/tmp/tmpxft_000026f9_00000000-4_cudadevice.cudafe1.c" --stub_file_name "/tmp/tmpxft_000026f9_00000000-4_cudadevice.cudafe1.stub.c" --gen_device_file_name "/tmp/tmpxft_000026f9_00000000-4_cudadevice.cudafe1.gpu" --nv_arch "compute_30" --gen_module_id_file --module_id_file_name "/tmp/tmpxft_000026f9_00000000-3_cudadevice.module_id" --include_file_name "tmpxft_000026f9_00000000-2_cudadevice.fatbin.c" "/tmp/tmpxft_000026f9_00000000-7_cudadevice.cpp1.ii"

i have admit have no clue can next...

update:

os: sles 11 sp3 nsight 7.5 gcc 4.9.3 -wall -werror -wextra 

update:

using const char * format string not option because want keep format check performed compiler.

mark nvidia confirmed bug , fixed in cuda 8.

for moment extracted log messages .cpp file avoid warnings each time compile project.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

android - Keyboard hides my half of edit-text and button below it even in scroll view -