summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2010-07-09 11:10:04 +0000
committerEli Zaretskii <eliz@gnu.org>2010-07-09 11:10:04 +0000
commit4e4d8f246f82d492fb71bc599813016ef97be397 (patch)
treecc083fe16c68e8634a8d8b7054a5b34253993a55 /main.c
parent8a0f9d7b429b32b106d8f46d32c8d5213683fbda (diff)
downloadgunmake-4e4d8f246f82d492fb71bc599813016ef97be397.tar.gz
job.c (pid2str) [WINDOWS32]: Don't use %Id with GCC < 4.x.
(exec_command) [WINDOWS32]: Use pid2str instead of non-portable %Id. main.c (handle_runtime_exceptions): Use %p to print addresses, to DTRT on both 32-bit and 64-bit hosts. Savannah bug #27809. job.c (w32_kill, start_job_command, create_batch_file): Use pid_t for process IDs and intptr_t for the 1st arg of _open_osfhandle. function.c (windows32_openpipe): Use pid_t for process IDs and intptr_t for the 1st arg of _open_osfhandle. (func_shell): Use pid_t for process IDs. main.c (main) [WINDOWS32]: Pacify the compiler. config.h.W32.template (pid_t): Add a definition for 64-bit Windows builds that don't use GCC. Savannah bug #27809. Patch by Ozkan Sezer <sezeroz@gmail.com>
Diffstat (limited to 'main.c')
-rw-r--r--main.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/main.c b/main.c
index c972e65..d7f3253 100644
--- a/main.c
+++ b/main.c
@@ -681,24 +681,24 @@ handle_runtime_exceptions( struct _EXCEPTION_POINTERS *exinfo )
if (! ISDB (DB_VERBOSE))
{
sprintf(errmsg,
- _("%s: Interrupt/Exception caught (code = 0x%lx, addr = 0x%lx)\n"),
- prg, exrec->ExceptionCode, (DWORD)exrec->ExceptionAddress);
+ _("%s: Interrupt/Exception caught (code = 0x%lx, addr = 0x%p)\n"),
+ prg, exrec->ExceptionCode, exrec->ExceptionAddress);
fprintf(stderr, errmsg);
exit(255);
}
sprintf(errmsg,
- _("\nUnhandled exception filter called from program %s\nExceptionCode = %lx\nExceptionFlags = %lx\nExceptionAddress = %lx\n"),
+ _("\nUnhandled exception filter called from program %s\nExceptionCode = %lx\nExceptionFlags = %lx\nExceptionAddress = 0x%p\n"),
prg, exrec->ExceptionCode, exrec->ExceptionFlags,
- (DWORD)exrec->ExceptionAddress);
+ exrec->ExceptionAddress);
if (exrec->ExceptionCode == EXCEPTION_ACCESS_VIOLATION
&& exrec->NumberParameters >= 2)
sprintf(&errmsg[strlen(errmsg)],
(exrec->ExceptionInformation[0]
- ? _("Access violation: write operation at address %lx\n")
- : _("Access violation: read operation at address %lx\n")),
- exrec->ExceptionInformation[1]);
+ ? _("Access violation: write operation at address 0x%p\n")
+ : _("Access violation: read operation at address 0x%p\n")),
+ (PVOID)exrec->ExceptionInformation[1]);
/* turn this on if we want to put stuff in the event log too */
#ifdef USE_EVENT_LOG
@@ -967,8 +967,10 @@ main (int argc, char **argv, char **envp)
/* Set up gettext/internationalization support. */
setlocale (LC_ALL, "");
- bindtextdomain (PACKAGE, LOCALEDIR);
- textdomain (PACKAGE);
+ /* The cast to void shuts up compiler warnings on systems that
+ disable NLS. */
+ (void)bindtextdomain (PACKAGE, LOCALEDIR);
+ (void)textdomain (PACKAGE);
#ifdef POSIX
sigemptyset (&fatal_signal_set);
@@ -1400,7 +1402,7 @@ main (int argc, char **argv, char **envp)
/* WINDOWS32 chdir() doesn't work if the directory has a trailing '/'
But allow -C/ just in case someone wants that. */
{
- char *p = dir + strlen (dir) - 1;
+ char *p = (char *)dir + strlen (dir) - 1;
while (p > dir && (p[0] == '/' || p[0] == '\\'))
--p;
p[1] = '\0';