Bug 7950 - jc1 parses files ending in 0x0d incorrectly
Summary: jc1 parses files ending in 0x0d incorrectly
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 3.3
: P3 normal
Target Milestone: ---
Assignee: Tom Tromey
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2002-09-17 07:16 UTC by Anthony Green
Modified: 2003-07-25 17:33 UTC (History)
3 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments
eofparse.java.gz (79 bytes, application/x-gzip )
2003-05-21 15:17 UTC, Anthony Green
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Green 2002-09-17 07:16:01 UTC
	I've come across some java source which emacs claims is a
"Mac" file (presumably edited on a Mac).  In any case, it uses 0x0d as
the end-of-line character.  gcj reports an error when this is the last
character in a source file.

Release:
3.3 20020908 (experimental)

Environment:
System: Linux dewey 2.4.7-10smp #1 SMP Thu Sep 6 17:09:31 EDT 2001 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: /home/green/FSF/GCC/HEAD/gcc/configure --prefix=/es/scratch/green/FSF/i --enable-languages=c,c++,java --with-languages=c,c++,java --enable-threads : (reconfigured)

How-To-Repeat:
I will upload a test source file to the gnats page when it is created.  But
you reall just need any source file which ends in 0x0d.

$ gcj -C /tmp/eofparse.java
/tmp/eofparse.java:4: Invalid character `\uffff' in input.
   ^
1 error
Comment 1 Tom Tromey 2002-09-17 14:01:21 UTC
Responsible-Changed-From-To: unassigned->tromey
Responsible-Changed-Why: I'm handling this.
Comment 2 Tom Tromey 2002-09-17 14:01:21 UTC
State-Changed-From-To: open->closed
State-Changed-Why: I checked in the fix.
Comment 3 Tom Tromey 2002-09-17 20:59:53 UTC
From: tromey@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: java/7950
Date: 17 Sep 2002 20:59:53 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	tromey@gcc.gnu.org	2002-09-17 13:59:53
 
 Modified files:
 	gcc/java       : ChangeLog lex.c 
 
 Log message:
 	* lex.c (java_read_unicode_collapsing_terminators): Handle case
 	where \r appears at EOF.  Fixes PR java/7950.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&r1=1.1054&r2=1.1055
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/lex.c.diff?cvsroot=gcc&r1=1.90&r2=1.91
 

Comment 4 Jakub Jelinek 2002-10-16 21:26:49 UTC
From: jakub@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: java/7950
Date: 16 Oct 2002 21:26:49 -0000

 CVSROOT:	/cvs/gcc
 Module name:	egcs
 Branch: 	gcc-3_2-rhl8-branch
 Changes by:	jakub@gcc.gnu.org	2002-10-16 14:26:48
 
 Modified files:
 	gcc            : ChangeLog expr.c langhooks-def.h langhooks.h 
 	                 langhooks.c fold-const.c Makefile.in 
 	gcc/java       : ChangeLog parse.y lang.c lex.c jcf-write.c 
 	                 expr.c except.c verify.c jcf-dump.c 
 	libjava/testsuite/libjava.lang: Array_3.java 
 	libjava/testsuite: ChangeLog 
 Added files:
 	libjava/testsuite/libjava.compile: narrow_case.java zeroexp.java 
 	libjava/testsuite/libjava.lang: EvaluationOrder.java 
 	                                EvaluationOrder.out 
 	                                utf8concat.java 
 
 Log message:
 	gcc/
 	2002-10-16  Jakub Jelinek  <jakub@redhat.com>
 	
 	* fold-const.c: Include langhooks.h.
 	* Makefile.in (fold-const.o): Depend on langhooks.h.
 	
 	2002-08-21  Tom Tromey  <tromey@redhat.com>
 	
 	For PR java/6005 and PR java/7611:
 	* fold-const.c (fold_truthop): Use can_use_bit_fields_p.
 	(fold): Likewise.
 	* langhooks.c (lhd_can_use_bit_fields_p): New function.
 	* langhooks-def.h (lhd_can_use_bit_fields_p): Declare.
 	(LANG_HOOKS_CAN_USE_BIT_FIELDS_P): New define.
 	(LANG_HOOKS_INITIALIZER): Use it.
 	* langhooks.h (struct lang_hooks) [can_use_bit_fields_p]: New
 	field.
 	
 	2002-07-24  Richard Henderson  <rth@redhat.com>
 	
 	* expr.c (expand_expr) [TRY_FINALLY_EXPR]: Use GOTO_SUBROUTINE_EXPR
 	form when not optimizing.
 	
 	2002-07-21  Richard Henderson  <rth@redhat.com>
 	
 	* expr.c (expand_expr) [TRY_FINALLY_EXPR]: Don't use
 	GOTO_SUBROUTINE_EXPR when finally_block can be re-expanded.
 	
 	gcc/java/
 	2002-10-15  Andrew Haley  <aph@redhat.com>
 	
 	* parse.y (patch_invoke): Call force_evaluation_order on a static
 	arg list.
 	(resolve_qualified_expression_name): Call force_evaluation_order
 	on a arg list that is part of a Qualified Expression Name.
 	
 	2002-10-09  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 	
 	* parse.y (merge_string_cste): Add parentheses around & within |.
 	
 	2002-10-08  Tom Tromey  <tromey@redhat.com>
 	
 	* parse.y (variable_declarator_id): Simplify error path for
 	array declarator error.  For PR java/8003.
 	
 	2002-10-07  Anthony Green  <green@redhat.com>
 	
 	* parse.y (merge_string_cste): Fix bug in string concatenation.
 	
 	2002-10-01  Nathan Sidwell  <nathan@codesourcery.com>
 	
 	* jcf-dump.c (print_constant, case CONSTANT_float): Don't fall
 	foul of type-based aliasing.
 	
 	2002-09-26  Andrew Haley  <aph@redhat.com>
 	
 	* expr.c (build_java_array_length_access): Check for null pointer.
 	* expr.c (expand_java_arrayload): Likewise.
 	
 	2002-09-17  Tom Tromey  <tromey@redhat.com>
 	
 	* lex.c (java_read_unicode_collapsing_terminators): Handle case
 	where \r appears at EOF.  Fixes PR java/7950.
 	
 	2002-09-11  Per Bothner  <per@bothner.com>
 	
 	* parse.y (fold_constant_for_init):  If a VAR_DECL, convert numerical
 	constant to the type of the field.
 	(java_complete_tree):  Remove now-redundant code.
 	
 	* parse.y (fold_constant_for_init):  'null' is not a constant expr.
 	
 	2002-09-03  Jesse Rosenstock  <jmr@ugcs.caltech.edu>
 	
 	For PR java/5794:
 	* verify.c (verify_jvm_instructions) [OPCODE_jsr]: Only push the
 	return label if a ret instruction for the jsr has been reached.
 	
 	2002-08-28  Andrew Haley  <aph@redhat.com>
 	
 	* verify.c (verify_jvm_instructions): Allow exception handler
 	inside code that is being protected, but generate a warning.
 	* except.c (link_handler): Initialize `expanded' in new eh_range.
 	(binding_depth, is_class_level, current_pc): Declare extern.
 	
 	2002-08-26  Tom Tromey  <tromey@redhat.com>
 	
 	* parse.y (try_builtin_assignconv): Allow narrowing primitive
 	conversion if RHS_TYPE is byte, short, or char.
 	
 	2002-08-21  Tom Tromey  <tromey@redhat.com>
 	
 	For PR java/6005 and PR java/7611:
 	* lang.c (LANG_HOOKS_CAN_USE_BITFIELDS_P): New define.
 	(java_can_use_bit_fields_p): New function.
 	
 	2002-08-08  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
 	
 	* jcf-write.c (get_access_flags): Return correct access flags for
 	private and protected inner classes.
 	
 	2002-07-22  Tom Tromey  <tromey@redhat.com>
 	
 	* lex.c (java_lex): Check for `e' or `E' after 0.
 	
 	2002-07-21  Richard Henderson  <rth@redhat.com>
 	
 	* lang.c (java_unsafe_for_reeval): New.
 	(LANG_HOOKS_UNSAFE_FOR_REEVAL): New.
 	
 	2002-07-01  Tom Tromey  <tromey@redhat.com>
 	
 	For PR libgcj/7073:
 	* parse.y (patch_incomplete_class_ref): Handle VOID_TYPE
 	specially.
 	
 	libjava/testsuite/
 	2002-10-15  Andrew Haley  <aph@redhat.com>
 	
 	* libjava.lang/EvaluationOrder.java (EvaluationOrder): New.
 	* libjava.lang/EvaluationOrder.out (EvaluationOrder): New.
 	
 	2002-10-03  Andrew Haley  <aph@redhat.com>
 	
 	* libjava.lang/Array_3.java (baz): New.
 	(main): Call baz.
 	
 	2002-09-29  Anthony Green  <green@redhat.com>
 	
 	* libjava.lang/utf8concat.java: New file.
 	* libjava.lang/utf8concat.out: Ditto.
 	
 	2002-08-26  Tom Tromey  <tromey@redhat.com>
 	
 	* libjava.compile/narrow_case.java: New file.
 	
 	2002-07-22  Tom Tromey  <tromey@redhat.com>
 	
 	* libjava.compile/zeroexp.java: New file.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.13152.2.657.2.27.2.21&r2=1.13152.2.657.2.27.2.22
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/expr.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.423.2.19.4.1.2.3&r2=1.423.2.19.4.1.2.4
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/langhooks-def.h.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.8.10.2.2.1.2.2&r2=1.8.10.2.2.1.2.3
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/langhooks.h.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.15.8.2.2.1.2.2&r2=1.15.8.2.2.1.2.3
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/langhooks.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.16.2.2.4.1.2.2&r2=1.16.2.2.4.1.2.3
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/fold-const.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.185.2.4.4.1&r2=1.185.2.4.4.2
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/Makefile.in.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.830.2.15.4.3&r2=1.830.2.15.4.4
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/java/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.925.2.59.2.2.2.2&r2=1.925.2.59.2.2.2.3
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/java/parse.y.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.353.2.19&r2=1.353.2.19.4.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/java/lang.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.85.2.4.4.2&r2=1.85.2.4.4.3
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/java/lex.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.80.8.4&r2=1.80.8.4.8.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/java/jcf-write.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.99.2.4&r2=1.99.2.4.4.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/java/expr.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.132.2.10&r2=1.132.2.10.4.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/java/except.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.26.20.1&r2=1.26.20.1.8.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/java/verify.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.47&r2=1.47.14.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/java/jcf-dump.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.42.2.2&r2=1.42.2.2.8.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libjava/testsuite/libjava.compile/narrow_case.java.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=NONE&r2=1.1.16.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libjava/testsuite/libjava.compile/zeroexp.java.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=NONE&r2=1.1.18.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libjava/testsuite/libjava.lang/EvaluationOrder.java.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=NONE&r2=1.1.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libjava/testsuite/libjava.lang/EvaluationOrder.out.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=NONE&r2=1.1.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libjava/testsuite/libjava.lang/utf8concat.java.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=NONE&r2=1.1.10.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libjava/testsuite/libjava.lang/Array_3.java.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.1&r2=1.1.26.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/libjava/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.177.2.24.2.2&r2=1.177.2.24.2.2.2.1