Go to file
David Malcolm 954ad1127e libcpp: show macro definition when used with wrong argument count
Consider:

demo.c: In function 'test':
demo.c:5:40: error: macro "LOG_2" requires 3 arguments, but only 2 given
5 |   LOG_2 ("loading file: %s\n", filename);
  |                                        ^

This patch adds a note showing the definition of the macro in
question, giving:

demo.c: In function 'test':
demo.c:5:40: error: macro "LOG_2" requires 3 arguments, but only 2 given
5 |   LOG_2 ("loading file: %s\n", filename);
  |                                        ^
In file included from demo.c:1:
logging.h:1: note: macro "LOG_2" defined here
1 | #define LOG_2(FMT, ARG0, ARG1) do { fprintf (stderr, (FMT), (ARG0), (ARG1)); }
  | 

gcc/testsuite/ChangeLog:
	* g++.dg/diagnostic/macro-arg-count.C: Move to...
	* c-c++-common/cpp/macro-arg-count-1.c: ...here, generalizing
	output for C vs C++.  Expect notes showing the definitions of the
	macros.
	* c-c++-common/cpp/macro-arg-count-2.c: New test, adapted from the
	above.

libcpp/ChangeLog:
	* macro.c (_cpp_arguments_ok): If the argument count is wrong, add
	a note showing the definition of the macro.

From-SVN: r265040
2018-10-11 13:21:28 +00:00
INSTALL
config
contrib contrib: unused_functions.py: Handle archives 2018-10-05 00:28:18 +02:00
fixincludes
gcc libcpp: show macro definition when used with wrong argument count 2018-10-11 13:21:28 +00:00
gnattools
gotools Ignore chmod errors during mostlyclean-local, check-go-tool 2018-09-26 12:56:09 +00:00
include
intl
libada
libatomic
libbacktrace re PR libbacktrace/87529 (libbacktrace API forces users to have memory leaks) 2018-10-05 14:09:07 +00:00
libcc1
libcpp libcpp: show macro definition when used with wrong argument count 2018-10-11 13:21:28 +00:00
libdecnumber
libffi
libgcc * config/pdp11/t-pdp11: Remove -mfloat32 switch. 2018-10-08 12:49:48 -04:00
libgfortran Use gfc_charlen_type instead of int for string lenghts 2018-10-06 21:21:00 +03:00
libgo runtime: skip testSetPanicOnFault for gollvm 2018-10-09 16:51:10 +00:00
libgomp
libhsail-rt
libiberty [libiberty] Use pipe inside pex_run 2018-10-01 18:46:51 +00:00
libitm
libobjc
liboffloadmic
libquadmath
libsanitizer
libssp
libstdc++-v3 Make ext allocators support heterogeneous equality comparison 2018-10-11 12:32:29 +01:00
libvtv
lto-plugin
maintainer-scripts
zlib
.dir-locals.el
.gitattributes
.gitignore
ABOUT-NLS
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
ChangeLog List myself as "libgomp (OpenACC)" and "OpenACC" maintainer 2018-10-04 17:50:34 +02:00
ChangeLog.jit
ChangeLog.tree-ssa
MAINTAINERS List myself as "libgomp (OpenACC)" and "OpenACC" maintainer 2018-10-04 17:50:34 +02:00
Makefile.def
Makefile.in
Makefile.tpl
README
compile
config-ml.in
config.guess
config.rpath
config.sub
configure
configure.ac
depcomp
install-sh
libtool-ldflags
libtool.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
missing
mkdep
mkinstalldirs
move-if-change
symlink-tree
ylwrap

README

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.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.