Go to file
Ollie Wild 7f5f5f98c5 Add new option, -Wliteral-suffix.
This option, which is enabled by default, causes the preprocessor to warn
when a string or character literal is followed by a ud-suffix which does
not begin with an underscore.  According to [lex.ext]p10, this is
ill-formed.

Also modifies the preprocessor to treat such ill-formed suffixes as separate
preprocessing tokens.  This is consistent with the Clang front end (see
http://llvm.org/viewvc/llvm-project?view=rev&revision=152287), and enables
backwards compatibility with code that uses formatting macros from
<inttypes.h>, as in the following code block:

  int main() {
    int64_t i64 = 123;
    printf("My int64: %"PRId64"\n", i64);
  }

Google ref b/6377711.

2012-04-27   Ollie Wild  <aaw@google.com>

	PR c++/52538
	* gcc/c-family/c-common.c: Add CPP_W_LITERAL_SUFFIX mapping.
	* gcc/c-family/c-opts.c (c_common_handle_option): Handle
	OPT_Wliteral_suffix.
	* gcc/c-family/c.opt: Add Wliteral-suffix.
	* gcc/doc/invoke.texi (Wliteral-suffix): Document new option.
	* gcc/testsuite/g++.dg/cpp0x/Wliteral-suffix.c: New test.
	* libcpp/include/cpplib.h (struct cpp_options): Add new field,
	warn_literal_suffix.
	(CPP_W_LITERAL_SUFFIX): New enum.
	* libcpp/init.c (cpp_create_reader): Default initialization of
	warn_literal_suffix.
	* libcpp/lex.c (lex_raw_string): Treat user-defined literals which
	don't begin with '_' as separate tokens and produce a warning.
	(lex_string): Ditto.

From-SVN: r186909
2012-04-27 14:29:32 +00:00
boehm-gc Fix changelog format. 2012-02-28 18:02:56 +00:00
config mmap.m4: Use *vms* instead of vms*. 2012-04-03 12:07:28 +00:00
contrib compare_tests: Append '/' to make 'find' traverse symlinked directories. 2012-04-24 07:22:41 +00:00
fixincludes fixincl.c (fix_with_system): Add missing specifier. 2012-04-24 09:24:55 +00:00
gcc Add new option, -Wliteral-suffix. 2012-04-27 14:29:32 +00:00
gnattools Remove obsolete IRIX 6.5 support 2012-03-14 16:33:37 +00:00
include dwarf2out.c (dwarf_stack_op_name): Use get_DW_OP_name. 2012-04-27 14:14:14 +00:00
INSTALL
intl
libada Makefile.in (bindir): Import from autoconf and pass down to submake. 2012-02-24 16:17:01 +00:00
libcpp Add new option, -Wliteral-suffix. 2012-04-27 14:29:32 +00:00
libdecnumber warnings.m4 (ACX_PROG_CC_WARNING_OPTS): Avoid leading dash in expr call. 2011-12-20 16:54:12 +00:00
libffi ffi.c (ffi_prep_args_SYSV): Declare double_tmp. 2012-04-02 13:29:22 -05:00
libgcc i386-cpuinfo.c (FEATURE_AVX2): New enum value. 2012-04-26 00:52:09 +00:00
libgfortran re PR libfortran/53051 (I/O: Support reading floating-point numbers which use "Q" for the exponent) 2012-04-22 19:28:34 +02:00
libgo mksysinfo, net: Always define syscall.SO_REUSEPORT. 2012-04-26 04:25:56 +00:00
libgomp prune.exp (TEST_ALWAYS_FLAGS): If undefined, set to empty. 2012-04-11 20:15:35 +00:00
libiberty dwarf2out.c (dwarf_stack_op_name): Use get_DW_OP_name. 2012-04-27 14:14:14 +00:00
libitm Use long long in gtm_jmpbuf for x86-64 2012-04-04 08:49:23 -07:00
libjava defineclass.cc (MAJOR_1_7, MINOR_1_7): New. 2012-04-23 13:33:32 +00:00
libmudflap re PR c++/24985 (caret diagnostics) 2012-04-11 09:26:48 +00:00
libobjc Remove obsolete Tru64 UNIX V5.1B support 2012-03-12 15:35:56 +00:00
libquadmath Additional fixes for FreeBSD-10 build: 2011-11-21 20:22:35 +01:00
libssp Additional fixes for FreeBSD-10 build: 2011-11-21 20:22:35 +01:00
libstdc++-v3 hashtable.h: Adjust doxygen markup for base classes. 2012-04-26 02:20:32 +00:00
lto-plugin re PR lto/50616 (lto1.exe: internal compiler error: invalid resolution in the resolution file) 2012-02-22 11:19:22 +01:00
maintainer-scripts crontab: Enable snapshots from gcc-4_7-branch. 2012-03-22 09:25:49 +00:00
zlib 2012-03-02 Matthias Klose <doko@ubuntu.com> 2012-03-02 17:15:20 +00:00
ABOUT-NLS
ChangeLog Update config.sub to 2012-04-18 version from official repo. 2012-04-25 15:48:28 +00:00
ChangeLog.tree-ssa
compile
config-ml.in
config.guess
config.rpath
config.sub Update config.sub to 2012-04-18 version from official repo. 2012-04-25 15:48:28 +00:00
configure Remove obsolete IRIX 6.5 support 2012-03-14 16:33:37 +00:00
configure.ac Remove obsolete IRIX 6.5 support 2012-03-14 16:33:37 +00:00
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.RUNTIME
depcomp
install-sh
libtool-ldflags
libtool.m4 Additional fixes for FreeBSD-10 build: 2011-11-21 20:22:35 +01:00
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS Add myself in Write After Approval list in MAINTAINERS file. 2012-04-24 07:49:14 +00:00
Makefile.def re PR bootstrap/51686 ("make install-strip-gcc" didn't install liblto-plugin* files) 2012-01-02 10:59:04 +00:00
Makefile.in re PR bootstrap/51686 ("make install-strip-gcc" didn't install liblto-plugin* files) 2012-01-02 10:59:04 +00:00
Makefile.tpl configure.ac: Add tool checks for READELF and READELF_FOR_TARGET. 2011-11-09 13:57:26 -05:00
missing
mkdep
mkinstalldirs
move-if-change
README
symlink-tree
ylwrap

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.