Bug 31932 - cpp -f*-charset and gcj --encoding accept no values except UTF-8
Summary: cpp -f*-charset and gcj --encoding accept no values except UTF-8
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: preprocessor (show other bugs)
Version: 4.1.3
: P3 normal
Target Milestone: 4.5.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-15 11:18 UTC by serg
Modified: 2009-04-16 19:05 UTC (History)
5 users (show)

See Also:
Host: i386-portbld-freebsd6.2
Target: i386-portbld-freebsd6.2
Build: i386-portbld-freebsd6.2
Known to work: 4.5.0
Known to fail:
Last reconfirmed: 2009-03-29 23:48:10


Attachments
Removes HAVE_ICONV_H from source code. (652 bytes, patch)
2007-05-15 11:25 UTC, serg
Details | Diff
Removes HAVE_ICONV_H from source code. (856 bytes, patch)
2007-05-15 20:08 UTC, serg
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description serg 2007-05-15 11:18:19 UTC
Parts of gcc are compiled without libiconv even if it's present in the system and --with-libiconv-prefix specified correctly.

The reason for this is usage of HAVE_ICONV_H macro.

1. The check for iconv.h in configure does not use the value of --with-libiconv-prefix option.

2. HAVE_ICONV_H is useless because check for libiconv uses iconv.h anyway.

3. HAVE_ICONV is changed in some source files like this:

#ifndef HAVE_ICONV_H
#undef HAVE_ICONV
#endif

- which is inherently incorrect in and of itself: any information produced by configure must not be changed in the source code. If configure tests don't work right - fix them, but all source code must be compiled with the same global settings.
Comment 1 serg 2007-05-15 11:25:09 UTC
Created attachment 13557 [details]
Removes HAVE_ICONV_H from source code.

This should fix the bug. And, probably, some other problems with gcc not using iconv.
Comment 2 Andrew Pinski 2007-05-15 15:33:39 UTC
This code has been removed in 4.3.0 anyways as the java source parser is gone.  Only the bytecode parser exists on the trunk.
Comment 3 serg 2007-05-15 17:29:49 UTC
(In reply to comment #2)
> This code has been removed in 4.3.0 anyways as the java source parser is gone. 
> Only the bytecode parser exists on the trunk.

That still means 4.1 and 4.2 branches can be fixed.

Also not only java source parser is affected: libcpp/internal.h has this bug too. I just don't know how to expose it there.

Which component should I tag as buggy? libstdc++?
Comment 4 Paolo Carlini 2007-05-15 19:30:32 UTC
I don't think libstdc++ (the C++ runtime library) has anything to do with this.
Comment 5 Tom Tromey 2007-05-15 19:41:15 UTC
The patch is incomplete, as libcpp/configure.in still checks for iconv.h.

Anyway the best thing to do here is submit a patch or patches to the
gcc patch list.  Include a ChangeLog entry, etc.
Comment 6 Andrew Pinski 2007-05-15 19:43:16 UTC
libcpp is the C PreProcessor (not the standard C++ library).
Comment 7 serg 2007-05-15 20:08:34 UTC
Created attachment 13562 [details]
Removes HAVE_ICONV_H from source code.

Added libcpp/configure and libcpp/configure.ac to the patch.
Comment 8 serg 2007-05-15 20:34:41 UTC
(In reply to comment #6)
> libcpp is the C PreProcessor (not the standard C++ library).

Thanks. Now I know how to expose the bug here as well. It's -f*-charset options of cpp.


Comment 9 Tom Tromey 2009-03-30 20:54:38 UTC
Subject: Bug 31932

Author: tromey
Date: Mon Mar 30 20:54:18 2009
New Revision: 145316

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145316
Log:
2009-03-30  Sergiy Vyshnevetskiy  <serg@vostok.net>

	PR preprocessor/31932:
	* internal.h: Don't mention HAVE_ICONV_H.
	* configure, config.in: Rebuild.
	* configure.ac: Don't check for iconv.h.

Modified:
    trunk/libcpp/ChangeLog
    trunk/libcpp/config.in
    trunk/libcpp/configure
    trunk/libcpp/configure.ac
    trunk/libcpp/internal.h

Comment 10 Tom Tromey 2009-03-30 20:57:04 UTC
I checked in the fix on the trunk.
Comment 11 Tom Tromey 2009-03-30 20:57:36 UTC
Oops, updated wrong field.
Comment 12 Andrew Pinski 2009-04-16 19:05:50 UTC
Fixed so closing.