Quantcast
Channel: Tools
Viewing all articles
Browse latest Browse all 91752

Forum Post: RE: CCS warning for usage of function pointer

$
0
0

The signature (type and number of arguments etc.) of the function pointer must match the signature of the function assigned to it.  This example should make it clear ...

% type file.c struct {    void(*function)(void *); } gs ;  void works       (void *); void gets_warning(void  );  void try_stuff_out() {    gs.function = works;    gs.function = gets_warning; }   % armcl -mv7A8 --verbose_diagnostics --display_error_number file.c "file.c", line 11: warning #515-D: a value of type "void (*)(void)" cannot be           assigned to an entity of type "void (*)(void *)"      gs.function = gets_warning;                  ^

Thanks and regards,

-George


Viewing all articles
Browse latest Browse all 91752

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>