raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=932ae95a4e537916fe66952bdadf8928b7c4661e

commit 932ae95a4e537916fe66952bdadf8928b7c4661e
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Fri Aug 4 10:10:12 2017 +0900

    efl src - mark fallthrough switch statements in 3rd party code
    
    in code we importend that doesnt use eina we have warnings of
    fallthroughs. all o them are commented to be fallthrough so add the
    attribute there too to have fewer warnings.
---
 src/bin/edje/epp/cpplib.c                 | 23 +++++++++++++++++++++--
 src/static_libs/http-parser/http_parser.c |  6 ++++++
 src/static_libs/libunibreak/wordbreak.c   | 16 ++++++++++++++--
 3 files changed, 41 insertions(+), 4 deletions(-)

diff --git a/src/bin/edje/epp/cpplib.c b/src/bin/edje/epp/cpplib.c
index 48c19694b2..c901a1e0ff 100644
--- a/src/bin/edje/epp/cpplib.c
+++ b/src/bin/edje/epp/cpplib.c
@@ -3136,7 +3136,13 @@ get_directive_token(cpp_reader * pfile)
          case CPP_POP:
             if (!CPP_IS_MACRO_BUFFER(CPP_BUFFER(pfile)))
                return token;
-            /* ... else fall though ... */
+#ifndef __has_attribute
+# define __has_attribute(x) 0
+#endif
+#if __has_attribute(fallthrough)
+             __attribute__((fallthrough));
+#endif
+             /* ... else fall though ... */
          case CPP_HSPACE:
          case CPP_COMMENT:
             CPP_SET_WRITTEN(pfile, old_written);
@@ -4300,6 +4306,12 @@ skip_if_group(cpp_reader * pfile, int any)
                          validate_else(pfile,
                                        kt->type ==
                                        T_ELSE ? "#else" : "#endif");
+#ifndef __has_attribute
+# define __has_attribute(x) 0
+#endif
+#if __has_attribute(fallthrough)
+                       __attribute__((fallthrough));
+#endif
                        /* this fall through is intened */
                    case T_ELIF:
                       if (pfile->if_stack == CPP_BUFFER(pfile)->if_stack)
@@ -6748,7 +6760,14 @@ cpp_handle_options(cpp_reader * pfile, int argc, char 
**argv)
                    {
                       opts->out_fname = "";
                       break;
-                   }           /* else fall through into error */
+                   }
+#ifndef __has_attribute
+# define __has_attribute(x) 0
+#endif
+#if __has_attribute(fallthrough)
+                  __attribute__((fallthrough));
+#endif
+                  /* else fall through into error */
               default:
                  return i;
               }
diff --git a/src/static_libs/http-parser/http_parser.c 
b/src/static_libs/http-parser/http_parser.c
index 9695525b2c..cbe445b31e 100644
--- a/src/static_libs/http-parser/http_parser.c
+++ b/src/static_libs/http-parser/http_parser.c
@@ -2119,6 +2119,12 @@ http_parser_parse_url(const char *buf, size_t buflen, 
int is_connect,
       case s_req_server_with_at:
         found_at = 1;
 
+#ifndef __has_attribute
+# define __has_attribute(x) 0
+#endif
+#if __has_attribute(fallthrough)
+       __attribute__((fallthrough));
+#endif
       /* FALLTROUGH */
       case s_req_server:
         uf = UF_HOST;
diff --git a/src/static_libs/libunibreak/wordbreak.c 
b/src/static_libs/libunibreak/wordbreak.c
index 063badce4f..d90d77b799 100644
--- a/src/static_libs/libunibreak/wordbreak.c
+++ b/src/static_libs/libunibreak/wordbreak.c
@@ -210,7 +210,13 @@ static void set_wordbreaks(
                 posLast = posCur;
                 break;
             }
-            /* Fall off */
+#ifndef __has_attribute
+# define __has_attribute(x) 0
+#endif
+#if __has_attribute(fallthrough)
+           __attribute__((fallthrough));
+#endif
+           /* Fall off */
 
         case WBP_Newline:
             /* WB3a,3b */
@@ -323,7 +329,13 @@ static void set_wordbreaks(
                 wbcSeqStart = wbcCur;
                 posLast = posCur;
             }
-            /* No break on purpose */
+#ifndef __has_attribute
+# define __has_attribute(x) 0
+#endif
+#if __has_attribute(fallthrough)
+           __attribute__((fallthrough));
+#endif
+           /* No break on purpose */
         case WBP_MidNumLet:
             if (((wbcLast == WBP_ALetter) ||
                         (wbcLast == WBP_Hebrew_Letter)) || /* WB6,7 */

-- 


Reply via email to