epics-modules / autosave

APS BCDA synApps module: autosave
https://epics-modules.github.io/autosave/
Other
8 stars 31 forks source link

gcc style warnings #25

Closed mdavidsaver closed 5 years ago

mdavidsaver commented 5 years ago

I noticed that gcc 6.3.0 raises some warnings on what appear to me like missing brackets. I haven't looked to see if any of these are actually logic errors.

/usr/bin/gcc  -D_GNU_SOURCE -D_DEFAULT_SOURCE           -D_X86_64_  -DUNIX  -Dlinux     -O3 -g   -Wall     -DUSE_TYPED_RSET -DDBLOADRECORDSHOOKREGISTER  ....        -c ../dbrestore.c
../dbrestore.c: In function ‘SR_array_restore’:
../dbrestore.c:599:7: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
       if (*(++bp) == ELEMENT_END) bp++; break;
       ^~
../dbrestore.c:599:41: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
       if (*(++bp) == ELEMENT_END) bp++; break;
                                         ^~~~~
/usr/bin/gcc  -D_GNU_SOURCE -D_DEFAULT_SOURCE           -D_X86_64_  -DUNIX  -Dlinux     -O3 -g   -Wall     -DUSE_TYPED_RSET -DDBLOADRECORDSHOOKREGISTER ....        -c ../save_restore.c
../save_restore.c: In function ‘manual_array_restore’:
../save_restore.c:3115:7: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
       if (*(++bp) == ELEMENT_END) bp++; break;
       ^~
../save_restore.c:3115:41: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
       if (*(++bp) == ELEMENT_END) bp++; break;
                                         ^~~~~
/usr/bin/gcc  -D_GNU_SOURCE -D_DEFAULT_SOURCE           -D_X86_64_  -DUNIX  -Dlinux     -O3 -g   -Wall     -DUSE_TYPED_RSET -DDBLOADRECORDSHOOKREGISTER  ....        -c ../verify.c
../verify.c: In function ‘do_asVerify’:
../verify.c:84:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
   if (write_restore_file) fclose(fr); fr = NULL;
   ^~
../verify.c:84:39: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
   if (write_restore_file) fclose(fr); fr = NULL;
                                       ^~
../verify.c:96:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
   if (write_restore_file) fclose(fr); fr = NULL;
   ^~
../verify.c:96:39: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
   if (write_restore_file) fclose(fr); fr = NULL;
                                       ^~
../verify.c:156:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
     if (write_restore_file) fclose(fr); fr = NULL;
     ^~
../verify.c:156:41: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
     if (write_restore_file) fclose(fr); fr = NULL;
                                         ^~
../verify.c: In function ‘read_array’:
../verify.c:498:7: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
       if (*(++bp) == ELEMENT_END) bp++; break;
       ^~
../verify.c:498:41: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
       if (*(++bp) == ELEMENT_END) bp++; break;
                                         ^~~~~
mdavidsaver commented 5 years ago

I am building 3283ed19b7e2fcfc27b3b2dcef664a2ff97b69a7

keenanlang commented 5 years ago

Fixed in b21e357