]> git.eshelyaron.com Git - emacs.git/commitdiff
Port build to gcc -fcheck-pointer-bounds
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 26 Nov 2016 05:24:28 +0000 (21:24 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 26 Nov 2016 05:25:55 +0000 (21:25 -0800)
This does not let Emacs run, just build.
* lib-src/etags.c (main):
* lib-src/profile.c (main):
Use return, not exit.
* src/bytecode.c (BYTE_CODE_THREADED) [__CHKP__]:
Do not define, as -fcheck-pointer-bounds is incompatible with taking
addresses of labels.
* src/menu.c (Fx_popup_dialog): Use eassume, not eassert,
to pacify gcc -fcheck-pointer-bounds -Wnull-dereference.

lib-src/etags.c
lib-src/profile.c
src/bytecode.c
src/menu.c

index e5d76d4c59124e1e286ff3cc29ec6899aeec5169..6a722e0641c182dd0eb1e1debc27c842fc7facb3 100644 (file)
@@ -1330,7 +1330,7 @@ main (int argc, char **argv)
            pfatal (tagfile);
        }
 
-      exit (EXIT_SUCCESS);
+      return EXIT_SUCCESS;
     }
 
   /* From here on, we are in (CTAGS && !cxref_style) */
@@ -1383,7 +1383,7 @@ main (int argc, char **argv)
        z = stpcpy (z, tagfile);
        *z++ = ' ';
        strcpy (z, tagfile);
-       exit (system (cmd));
+       return system (cmd);
       }
   return EXIT_SUCCESS;
 }
index edd36cafd3780279c22d6df30f9f0b85c614734f..cfee5b8608f988d22a81e4ae13f80abc3c38b26c 100644 (file)
@@ -85,13 +85,13 @@ main (void)
          puts (get_time ());
          break;
        case 'q':
-         exit (EXIT_SUCCESS);
+         return EXIT_SUCCESS;
        }
       /* Anything remaining on the line is ignored.  */
       while (c != '\n' && c != EOF)
        c = getchar ();
     }
-  exit (EXIT_FAILURE);
+  return EXIT_FAILURE;
 }
 
 
index e2d8ab706c7960a8565b4c2282ad66a328239cf8..be39a81c5e9ae069a1d5c1a822ad2bc33c08ee9f 100644 (file)
@@ -46,7 +46,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
    indirect threaded, using GCC's computed goto extension.  This code,
    as currently implemented, is incompatible with BYTE_CODE_SAFE and
    BYTE_CODE_METER.  */
-#if (defined __GNUC__ && !defined __STRICT_ANSI__ \
+#if (defined __GNUC__ && !defined __STRICT_ANSI__ && !defined __CHKP__ \
      && !BYTE_CODE_SAFE && !defined BYTE_CODE_METER)
 #define BYTE_CODE_THREADED
 #endif
index 638810b36f8e0c5734307cd5b48fd865fbec88fd..807096795134371480e547cbc0dbdd309bccd345 100644 (file)
@@ -1540,7 +1540,7 @@ for instance using the window manager, then this produces a quit and
 
   /* Note that xw_popup_dialog can call menu code, so
      Vmenu_updating_frame should be set (Bug#17891).  */
-  eassert (f && FRAME_LIVE_P (f));
+  eassume (f && FRAME_LIVE_P (f));
   XSETFRAME (Vmenu_updating_frame, f);
 
   /* Force a redisplay before showing the dialog.  If a frame is created