Bug 7357

Summary: -M option omits system headers files (making it the same as -MM)
Product: gcc Reporter: pickina
Component: preprocessorAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: gcc-bugs, neil
Priority: P3    
Version: 3.1   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed:

Description pickina 2002-07-19 03:26:01 UTC
There is no distinction between -M & -MM option from 
version 3.1.0

This means the the system headers are omitted from dependencies.

Release:
3.1.0

Environment:
Solaris 8

How-To-Repeat:
gcc -M helloworld.c
compare with 
gcc -MM helloworld.c
should not stdio be listed somewhere?
Comment 1 Neil Booth 2002-07-19 13:52:33 UTC
State-Changed-From-To: open->closed
State-Changed-Why: Not true:
    
    monkey:neil{12}$ /usr/local/lib/gcc-lib/i586-pc-linux-gnu/3.1/cpp0 -MM /tmp/foo.c
    foo.o: /tmp/foo.c
    monkey:neil{13}$ /usr/local/lib/gcc-lib/i586-pc-linux-gnu/3.1/cpp0 -M /tmp/foo.c
    foo.o: /tmp/foo.c \
      /usr/local/lib/gcc-lib/i586-pc-linux-gnu/3.1/include/stdio.h \
      /usr/include/features.h /usr/include/sys/cdefs.h \
      /usr/include/gnu/stubs.h \
      /usr/local/lib/gcc-lib/i586-pc-linux-gnu/3.1/include/stddef.h \
      /usr/include/bits/types.h /usr/include/bits/pthreadtypes.h \
      /usr/include/bits/sched.h /usr/include/libio.h /usr/include/_G_config.h \
      /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \
      /usr/local/lib/gcc-lib/i586-pc-linux-gnu/3.1/include/stdarg.h \
      /usr/include/bits/stdio_lim.h
    
    If it's not working for you, then I suspect it is a configuration or installation problem where GCC does not have the right idea of your system directories.
Comment 2 Neil Booth 2002-08-15 19:46:45 UTC
From: neil@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: preprocessor/7357
Date: 15 Aug 2002 19:46:45 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_2-branch
 Changes by:	neil@gcc.gnu.org	2002-08-15 12:46:44
 
 Modified files:
 	gcc            : ChangeLog cppfiles.c cppinit.c cpplib.h 
 	                 cpplib.c 
 	gcc/testsuite  : ChangeLog 
 	gcc/doc        : cpp.texi cppenv.texi 
 Added files:
 	gcc/testsuite/gcc.dg/cpp: _Pragma3.c vararg3.c vararg4.c 
 
 Log message:
 	PR preprocessor/7358
 	PR preprocessor/7357
 	PR preprocessor/7526
 	* cppfiles.c (stack_include_file): Ignore main file if
 	appropriate.  Correct test of whether a dependency should
 	be output.
 	* cppinit.c (init_dependency_output): Ignore main file
 	for SUNPRO_DEPENDENCIES.
 	(struct lang_flags): Rename trigraphs std.
 	(set_lang): Update.
 	* cpplib.c (run_directive): Kludge so _Pragma dependency works.
 	* cpplib.h (struct cpp_options): New members.
 	* cppmacro.c (collect_args): Flag whether to swallow a possible
 	future comma pasted with varargs.
 	(replace_args): Use this flag.
 	* doc/cpp.texi: Update varargs extension documentation.
 	* doc/cppenv.texi: Update.
 	testsuite:
 	* gcc.dg/cpp/_Pragma3.c, gcc.dg/cpp/vararg3.c, gcc.dg/cpp/vararg4.c:
 	New tests.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.13152.2.657.2.12&r2=1.13152.2.657.2.13
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cppfiles.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.144&r2=1.144.6.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cppinit.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.202.2.5&r2=1.202.2.5.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cpplib.h.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.201.2.1&r2=1.201.2.1.4.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cpplib.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.290.2.1&r2=1.290.2.1.4.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.1672.2.166.2.5&r2=1.1672.2.166.2.6
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/doc/cpp.texi.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.24.2.3&r2=1.24.2.3.4.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/doc/cppenv.texi.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.1.2.1&r2=1.1.2.1.4.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/cpp/_Pragma3.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/cpp/vararg3.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.8.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/cpp/vararg4.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.8.1
 

Comment 3 Neil Booth 2002-08-15 19:47:46 UTC
From: neil@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: preprocessor/7357
Date: 15 Aug 2002 19:47:46 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_2-branch
 Changes by:	neil@gcc.gnu.org	2002-08-15 12:47:46
 
 Modified files:
 	gcc            : cppmacro.c 
 
 Log message:
 	PR preprocessor/7358
 	PR preprocessor/7357
 	PR preprocessor/7526
 	* cppfiles.c (stack_include_file): Ignore main file if
 	appropriate.  Correct test of whether a dependency should
 	be output.
 	* cppinit.c (init_dependency_output): Ignore main file
 	for SUNPRO_DEPENDENCIES.
 	(struct lang_flags): Rename trigraphs std.
 	(set_lang): Update.
 	* cpplib.c (run_directive): Kludge so _Pragma dependency works.
 	* cpplib.h (struct cpp_options): New members.
 	* cppmacro.c (collect_args): Flag whether to swallow a possible
 	future comma pasted with varargs.
 	(replace_args): Use this flag.
 	* doc/cpp.texi: Update varargs extension documentation.
 	* doc/cppenv.texi: Update.
 	testsuite:
 	* gcc.dg/cpp/_Pragma3.c, gcc.dg/cpp/vararg3.c, gcc.dg/cpp/vararg4.c:
 	New tests.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cppmacro.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.91.6.6&r2=1.91.6.6.2.1