From: Andrew Cagney Date: Wed, 14 Mar 2001 16:42:30 +0000 (+0000) Subject: Eliminate some uses of __STDC__. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5bb367b1d911e5893a504ebd2ac301f55cd3ec79;p=binutils-gdb.git Eliminate some uses of __STDC__. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f9de7cf7486..9b0bcaf0c1e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,19 @@ +2001-03-13 Andrew Cagney + + * ui-out.h: Remove #if __STDC__, assume an ISO-C compiler. + * m3-nat.c: Ditto. + * p-lang.h: Ditto. + * printcmd.c (printf_command): Ditto. + * ch-exp.c (match_integer_literal): Ditto. + * scm-tags.h: Ditto. + * ser-go32.c: Ditto. + * hppa-tdep.c (unwind_command): Ditto. + * defs.h (volatile): Delete macro definition. Assume __STDC__. + * remote-adapt.c (volatile): Ditto. + * remote-eb.c (volatile): Ditto. + * remote-mm.c (volatile): Ditto. + * defs.h (alloca): Assume __STDC__, declare returning void *. + 2001-03-08 Andrew Cagney * inferior.h (ARCH_NUM_REGS): Delete definition. diff --git a/gdb/ch-exp.c b/gdb/ch-exp.c index c29e7b0799d..abd51878c28 100644 --- a/gdb/ch-exp.c +++ b/gdb/ch-exp.c @@ -1788,7 +1788,7 @@ match_integer_literal (void) else { yylval.typed_val.val = ival; -#if defined(CC_HAS_LONG_LONG) && defined(__STDC__) +#if defined(CC_HAS_LONG_LONG) if (ival > (LONGEST) 2147483647U || ival < -(LONGEST) 2147483648U) yylval.typed_val.type = builtin_type_long_long; else diff --git a/gdb/defs.h b/gdb/defs.h index c6a4637c4d6..66c3e78419a 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -764,23 +764,6 @@ enum val_prettyprint #define CONST_PTR const #endif -/* - * Allow things in gdb to be declared "volatile". If compiling ANSI, it - * just works. If compiling with gcc but non-ansi, redefine to __volatile__. - * If non-ansi, non-gcc, then eliminate "volatile" entirely, making those - * objects be read-write rather than read-only. - */ - -#ifndef volatile -#ifndef __STDC__ -#ifdef __GNUC__ -#define volatile __volatile__ -#else -#define volatile /* nothing */ -#endif /* GNUC */ -#endif /* STDC */ -#endif /* volatile */ - /* Defaults for system-wide constants (if not defined by xm.h, we fake it). FIXME: Assumes 2's complement arithmetic */ @@ -993,11 +976,7 @@ extern void free (); /* We need to be careful not to declare this in a way which conflicts with bison. Bison never declares it as char *, but under various circumstances (like __hpux) we need to use void *. */ -#if defined (__STDC__) || defined (__hpux) extern void *alloca (); -#else /* Don't use void *. */ -extern char *alloca (); -#endif /* Don't use void *. */ #endif /* Not _AIX */ #endif /* Not HAVE_ALLOCA_H */ #endif /* Not GNU C */ diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 3b5ee347db9..3a879088cde 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -4524,11 +4524,7 @@ unwind_command (char *exp, int from_tty) printf_unfiltered ("\n\tregion_end = "); print_address (u->region_end, gdb_stdout); -#ifdef __STDC__ #define pif(FLD) if (u->FLD) printf_unfiltered (" "#FLD); -#else -#define pif(FLD) if (u->FLD) printf_unfiltered (" FLD"); -#endif printf_unfiltered ("\n\tflags ="); pif (Cannot_unwind); @@ -4553,11 +4549,7 @@ unwind_command (char *exp, int from_tty) putchar_unfiltered ('\n'); -#ifdef __STDC__ #define pin(FLD) printf_unfiltered ("\t"#FLD" = 0x%x\n", u->FLD); -#else -#define pin(FLD) printf_unfiltered ("\tFLD = 0x%x\n", u->FLD); -#endif pin (Region_description); pin (Entry_FR); diff --git a/gdb/m3-nat.c b/gdb/m3-nat.c index 7e78881bdca..4fcf951d8e6 100644 --- a/gdb/m3-nat.c +++ b/gdb/m3-nat.c @@ -1832,13 +1832,8 @@ mach3_read_inferior (CORE_ADDR addr, char *myaddr, int length) return length; } -#ifdef __STDC__ #define CHK_GOTO_OUT(str,ret) \ do if (ret != KERN_SUCCESS) { errstr = #str; goto out; } while(0) -#else -#define CHK_GOTO_OUT(str,ret) \ - do if (ret != KERN_SUCCESS) { errstr = str; goto out; } while(0) -#endif struct vm_region_list { @@ -4225,11 +4220,7 @@ m3_open (char *arg, int from_tty) } #ifdef DUMP_SYSCALL -#ifdef __STDC__ #define STR(x) #x -#else -#define STR(x) "x" -#endif char *bsd1_names[] = { diff --git a/gdb/p-lang.h b/gdb/p-lang.h index c03e6324ad1..3dd2830c41b 100644 --- a/gdb/p-lang.h +++ b/gdb/p-lang.h @@ -19,9 +19,7 @@ /* This file is derived from c-lang.h */ -#ifdef __STDC__ /* Forward decls for prototypes */ struct value; -#endif extern int pascal_parse (void); /* Defined in p-exp.y */ diff --git a/gdb/printcmd.c b/gdb/printcmd.c index e3ad2fe2ba6..92e06efc804 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -2077,11 +2077,7 @@ printf_command (char *arg, int from_tty) *f++ = '\\'; break; case 'a': -#ifdef __STDC__ *f++ = '\a'; -#else - *f++ = '\007'; /* Bell */ -#endif break; case 'b': *f++ = '\b'; diff --git a/gdb/remote-adapt.c b/gdb/remote-adapt.c index e73236520a5..c52560b0f3f 100644 --- a/gdb/remote-adapt.c +++ b/gdb/remote-adapt.c @@ -309,12 +309,6 @@ get_hex_regs (int n, int regno) /* Called when SIGALRM signal sent due to alarm() timeout. */ #ifndef HAVE_TERMIO -#ifndef __STDC__ -#ifndef volatile -#define volatile -/**/ -# endif -#endif volatile int n_alarms; void diff --git a/gdb/remote-eb.c b/gdb/remote-eb.c index a3dc5814578..476b1507367 100644 --- a/gdb/remote-eb.c +++ b/gdb/remote-eb.c @@ -202,10 +202,6 @@ get_hex_regs (int n, int regno) /* Called when SIGALRM signal sent due to alarm() timeout. */ #ifndef HAVE_TERMIO -#ifndef __STDC__ -#define volatile -/**/ -#endif volatile int n_alarms; void diff --git a/gdb/remote-mm.c b/gdb/remote-mm.c index 6270ebe92f7..ed72d4bb642 100644 --- a/gdb/remote-mm.c +++ b/gdb/remote-mm.c @@ -118,12 +118,6 @@ FILE *mm_stream; /* Called when SIGALRM signal sent due to alarm() timeout. */ #ifndef HAVE_TERMIO -#ifndef __STDC__ -#ifndef volatile -#define volatile -/**/ -# endif -#endif volatile int n_alarms; static void diff --git a/gdb/scm-tags.h b/gdb/scm-tags.h index 3cd43c7c6f0..4fa5ce2d16d 100644 --- a/gdb/scm-tags.h +++ b/gdb/scm-tags.h @@ -375,11 +375,5 @@ extern int scm_tc16_key_vector; #endif /* 0 */ -#ifdef __STDC__ - -#else /* STDC */ - -#endif /* STDC */ - #endif /* TAGSH */ diff --git a/gdb/ser-go32.c b/gdb/ser-go32.c index ec1c3e0952b..e3d3bf525ca 100644 --- a/gdb/ser-go32.c +++ b/gdb/ser-go32.c @@ -355,11 +355,7 @@ dos_comisr (int irq) } } -#ifdef __STDC__ #define ISRNAME(x) dos_comisr##x -#else -#define ISRNAME(x) dos_comisr/**/x -#endif #define ISR(x) static void ISRNAME(x)() {dos_comisr(x);} ISR (0) ISR (1) ISR (2) ISR (3) diff --git a/gdb/ui-out.h b/gdb/ui-out.h index bb5834f5481..a7be1ed6015 100644 --- a/gdb/ui-out.h +++ b/gdb/ui-out.h @@ -25,10 +25,8 @@ /* The ui_out structure */ -#if __STDC__ struct ui_out; struct ui_out_data; -#endif /* the current ui_out */