ttrftech / NanoVNA

Very Tiny Palmtop Vector Network Analyzer
1.09k stars 305 forks source link

C Standard compliance failed #65

Closed qrp73 closed 5 years ago

qrp73 commented 5 years ago

Current code has some syntax tricks which have issue with C standard compliance. Please fix it. It's hard to merge all changes when this fix is not applied. Thanks.

The main issues are following:

1) implicit cast from void(*)() to void* Proposed solutions:

2) struct field initializers are not compatible with C standard Proposed solution: use C standard struct field initializers:

config_t config = {
  .magic =              CONFIG_MAGIC,
  .dac_value =          1922,
  .grid_color =         0x1084,
 //...
};

3) Binary constants are not supported in C standard. Proposed solutions:

fix is already done in the following two changesets: