2011-07-07 Paul Eggert <eggert@cs.ucla.edu>
+ * emacs.c: Integer overflow minor fix.
+ (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
+ Define only if GNU_LINUX.
+ (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
+
* dispnew.c: Integer signedness and overflow fixes.
Remove unnecessary forward decls, that were a maintenance hassle.
(history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
/* The address where the heap starts (from the first sbrk (0) call). */
static void *my_heap_start;
+#ifdef GNU_LINUX
/* The gap between BSS end and heap start as far as we can tell. */
-static unsigned long heap_bss_diff;
+static uprintmax_t heap_bss_diff;
+#endif
/* Nonzero means running Emacs without interactive terminal. */
int noninteractive;
setenv ("G_SLICE", "always-malloc", 1);
#endif
+#ifdef GNU_LINUX
if (!initialized)
{
extern char my_endbss[];
heap_bss_diff = (char *)my_heap_start - max (my_endbss, my_endbss_static);
}
+#endif
#ifdef RUN_TIME_REMAP
if (initialized)
{
fprintf (stderr, "**************************************************\n");
fprintf (stderr, "Warning: Your system has a gap between BSS and the\n");
- fprintf (stderr, "heap (%lu bytes). This usually means that exec-shield\n",
+ fprintf (stderr, "heap (%"pMu" bytes). This usually means that exec-shield\n",
heap_bss_diff);
fprintf (stderr, "or something similar is in effect. The dump may\n");
fprintf (stderr, "fail because of this. See the section about\n");