#3645 Avoid double semicolon warnings on older compilers
Merged 6 years ago by lslebodn. Opened 6 years ago by asn.
SSSD/ asn/sssd master-fallthrough  into  master

file modified
+1 -1
@@ -459,7 +459,7 @@ 

               sss_cv_attribute_fallthrough_val="__attribute__ ((fallthrough))"

           ],[

               sss_cv_attribute_fallthrough=no

-              sss_cv_attribute_fallthrough_val=

+              sss_cv_attribute_fallthrough_val="((void)0)"

maybe we could expand that to comment which is recognized by linters, static analyzers. e.g. "/ fallthrough /"

I didn't test that because I already have gcc8 on my machine :-)

           ])

      ])

  CFLAGS=$SAFE_CFLAGS

Compilers that don't support fallthrough will end up with an empty
SSS_ATTRIBUTE_FALLTHROUGH define and just see a semicolon. The probably
will warn that there are double semicolons in the code.

Signed-off-by: Andreas Schneider asn@redhat.com

maybe we could expand that to comment which is recognized by linters, static analyzers. e.g. "/ fallthrough /"

I didn't test that because I already have gcc8 on my machine :-)

that would just add a comment to the #define

#define SSS_ATTRIBUTE_FALLTHROUGH ((void)0) /* fall through */

Commit 1ef36a8 fixes this pull-request

Pull-Request has been merged by lslebodn

6 years ago
Metadata