This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
-print-* command-line switches misbehave or are misdocumented
- From: Eli Zaretskii <eliz at gnu dot org>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 03 Jul 2009 13:03:55 +0300
- Subject: -print-* command-line switches misbehave or are misdocumented
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
Some of the -print-* command-line switches either don't work as
advertised or their documentation should be made more clear.
All of the examples below are with the following version of GCC:
gcc (GCC) 4.0.3 (Ubuntu 4.0.3-1ubuntu5)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I also tested with this version, with the same results.
gcc (GCC) 3.4.2 (mingw-special)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Please tell whether I should submit a bug report for some or all of
the below.
1. -print-multi-directory: Documentation is confusing and unclear.
The manual says:
`-print-multi-directory'
Print the directory name corresponding to the multilib selected by
any other switches present in the command line. This directory is
supposed to exist in `GCC_EXEC_PREFIX'.
But without having ``multilib'' explained anywhere else in the
manual, let alone having a cross-reference here to such a
description, there's no way to understand what this switch does.
2. -print-multi-lib: Same issue as with the previous switch.
3. -print-prog-name: Works only for some programs; manual text
misleading.
The manual says:
`-print-prog-name=PROGRAM'
Like `-print-file-name', but searches for a program such as `cpp'.
It fails to say what programs will this work with. The example it
gives, `cpp' doesn't work:
eliz@fencepost:~$ gcc -print-prog-name=cpp
cpp
Similarly, it doesn't work with `gcc' itself, which seems a pity,
as it doesn't allow to write scripts that discover where GCC
lives.
It works with cc1:
eliz@fencepost:~$ gcc -print-prog-name=cc1
/usr/lib/gcc/x86_64-linux-gnu/4.0.3/cc1
However, the manual should at least give a hint about which values
of PROGRAM will work here, and the example with `cpp' should be
removed.
Thanks.