diff options
author | Steven Bosscher <stevenb@suse.de> | 2004-10-17 22:51:35 +0000 |
---|---|---|
committer | Steven Bosscher <steven@gcc.gnu.org> | 2004-10-17 22:51:35 +0000 |
commit | 7cefa0c1657e51b054eddd25c682a22649317380 (patch) | |
tree | b6b89504cc8a80078f7f29637752de51fc170101 /gcc | |
parent | 7c672dfc01a1838168baf1a63d2ca0e303eb421c (diff) | |
download | gcc-7cefa0c1657e51b054eddd25c682a22649317380.zip gcc-7cefa0c1657e51b054eddd25c682a22649317380.tar.gz gcc-7cefa0c1657e51b054eddd25c682a22649317380.tar.bz2 |
class.c (ident_subst): Always alloca buffer.
* class.c (ident_subst): Always alloca buffer.
* java-opcodes.h (LAST_AND_UNUSED_JAVA_OPCODE): Add this dummy
opcode after including javaop.def.
* jcf-dump.c (CHECK_PC_IN_RANGE): Return 0 from the arm of the
conditional expression that exits, to avoid warnings.
* verify.c (CHECK_PC_IN_RANGE): Mark the __GNUC__ definition as
a user of an extension.
* win32-host.c: Move check down to have non-empty file when
WIN32 is not defined.
* Make-lang.in (java-warn): Add STRICT_WARN.
(java/jcf-io.o-warn): Don't have Werror for this file.
* jcf-io.c (caching_stat): Add FIXME for non-POSIX scandir use.
From-SVN: r89184
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/java/ChangeLog | 16 | ||||
-rw-r--r-- | gcc/java/Make-lang.in | 8 | ||||
-rw-r--r-- | gcc/java/class.c | 5 | ||||
-rw-r--r-- | gcc/java/java-opcodes.h | 1 | ||||
-rw-r--r-- | gcc/java/jcf-dump.c | 2 | ||||
-rw-r--r-- | gcc/java/jcf-io.c | 3 | ||||
-rw-r--r-- | gcc/java/verify.c | 3 | ||||
-rw-r--r-- | gcc/java/win32-host.c | 3 |
8 files changed, 31 insertions, 10 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 1f23930..37239af 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,19 @@ +2004-10-17 Steven Bosscher <stevenb@suse.de> + + * class.c (ident_subst): Always alloca buffer. + * java-opcodes.h (LAST_AND_UNUSED_JAVA_OPCODE): Add this dummy + opcode after including javaop.def. + * jcf-dump.c (CHECK_PC_IN_RANGE): Return 0 from the arm of the + conditional expression that exits, to avoid warnings. + * verify.c (CHECK_PC_IN_RANGE): Mark the __GNUC__ definition as + a user of an extension. + * win32-host.c: Move check down to have non-empty file when + WIN32 is not defined. + + * Make-lang.in (java-warn): Add STRICT_WARN. + (java/jcf-io.o-warn): Don't have Werror for this file. + * jcf-io.c (caching_stat): Add FIXME for non-POSIX scandir use. + 2004-10-16 Hans-Peter Nilsson <hp@bitrange.com> * expr.c (expr_add_location): Move declaration to before all diff --git a/gcc/java/Make-lang.in b/gcc/java/Make-lang.in index b74e83b..347a93d 100644 --- a/gcc/java/Make-lang.in +++ b/gcc/java/Make-lang.in @@ -118,11 +118,15 @@ JCFDUMP_OBJS = java/jcf-dump.o java/jcf-io.o java/jcf-depend.o java/jcf-path.o \ JVGENMAIN_OBJS = java/jvgenmain.o java/mangle_name.o errors.o intl.o -# Use loose warnings for this front end. -java-warn = $(WERROR) +# Use strict warnings for this front end. +java-warn = $(STRICT_WARN) + # String length warnings jvspec.o-warn = -Wno-error +# Use of non-standardized scandir +java/jcf-io.o-warn = -Wno-error + jc1$(exeext): $(JAVA_OBJS) $(BACKEND) $(LIBDEPS) rm -f $@ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ diff --git a/gcc/java/class.c b/gcc/java/class.c index a6c5d49..b90513f 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -268,11 +268,8 @@ ident_subst (const char* old_name, int prefix_len = strlen (prefix); int suffix_len = strlen (suffix); int i = prefix_len + old_length + suffix_len + 1; -#ifdef __GNUC__ - char buffer[i]; -#else char *buffer = alloca (i); -#endif + strcpy (buffer, prefix); for (i = 0; i < old_length; i++) { diff --git a/gcc/java/java-opcodes.h b/gcc/java/java-opcodes.h index 8fbe55c..12b3a72 100644 --- a/gcc/java/java-opcodes.h +++ b/gcc/java/java-opcodes.h @@ -2,4 +2,5 @@ enum java_opcode { #define JAVAOP(NAME, CODE, KIND, TYPE, VALUE) OPCODE_##NAME = CODE, #include "javaop.def" #undef JAVAOP +LAST_AND_UNUSED_JAVA_OPCODE }; diff --git a/gcc/java/jcf-dump.c b/gcc/java/jcf-dump.c index 2984c82..5f25369 100644 --- a/gcc/java/jcf-dump.c +++ b/gcc/java/jcf-dump.c @@ -1181,7 +1181,7 @@ disassemble_method (JCF* jcf, const unsigned char *byte_ops, int len) #define VAR_INDEX_2 (saw_index = 1, IMMEDIATE_u2) #define CHECK_PC_IN_RANGE(PC) (PC < 0 || PC > len ? \ - (fprintf(stderr, _("Bad byte codes.\n")), exit(-1)) : 1) + (fprintf(stderr, _("Bad byte codes.\n")), exit(-1), 0) : 1) /* Print out operand (if not implied by the opcode) for PUSCH opcodes. These all push a constant onto the opcode stack. */ diff --git a/gcc/java/jcf-io.c b/gcc/java/jcf-io.c index 6a418ab..e0ab03e 100644 --- a/gcc/java/jcf-io.c +++ b/gcc/java/jcf-io.c @@ -376,7 +376,8 @@ caching_stat (char *filename, struct stat *buf) particular, the type of the function pointer passed as the third argument sometimes takes a "const struct dirent *" parameter, and sometimes just a "struct dirent *". We cast - to (void *) so that either way it is quietly accepted. */ + to (void *) so that either way it is quietly accepted. + FIXME: scandir is not in POSIX. */ dent->num_files = scandir (filename, &dent->files, (void *) java_or_class_file, alphasort); diff --git a/gcc/java/verify.c b/gcc/java/verify.c index 9eae097..aaf7e4d 100644 --- a/gcc/java/verify.c +++ b/gcc/java/verify.c @@ -404,7 +404,8 @@ pop_argument_types (tree arg_types) { oldpc = LABEL_PC (tmplab); goto verify_error; }} while (0) #ifdef __GNUC__ -#define CHECK_PC_IN_RANGE(PC) ({if (PC < 0 || PC > length) goto bad_pc; (void)1;}) +#define CHECK_PC_IN_RANGE(PC) __extension__ \ + ({if (PC < 0 || PC > length) goto bad_pc; (void)1;}) #else #define CHECK_PC_IN_RANGE(PC) (PC < 0 || PC > length ? (abort (), 0) : 1) #endif diff --git a/gcc/java/win32-host.c b/gcc/java/win32-host.c index 915b5f6..a6e5309 100644 --- a/gcc/java/win32-host.c +++ b/gcc/java/win32-host.c @@ -24,13 +24,14 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ /* Written by Mohan Embar <gnustuff@thisiscool.com>, March 2003. */ -#ifdef WIN32 #include "config.h" #include "system.h" #include "coretypes.h" #include "jcf.h" +#ifdef WIN32 + #define WIN32_LEAN_AND_MEAN #include <windows.h> #undef WIN32_LEAN_AND_MEAN |