Eli Zaretskii <e...@gnu.org> writes: > 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.
Hi Eli. I'm sure you know that those are old versions of gcc, although your comments are still generall apropos. > Please tell whether I should submit a bug report for some or all of > the below. These options are generally intended for use by compiler developers, not by end users. I think it would be good to provide better documentation. But it's not high priority nor particularly interesting. Opening a bug report wouldn't hurt, but I doubt anybody would jump on it. > 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. I agree that this documentation is completely useless. multilib is documented, somewhat, in the internals manual. http://gcc.gnu.org/onlinedocs/gccint/Target-Fragment.html A reference over there would be reasonable. > 2. -print-multi-lib: Same issue as with the previous switch. Same answer. > 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: > > e...@fencepost:~$ gcc -print-prog-name=cpp > cpp Yeah, that's a clear doc bug. It used to work with "cpp", but not with current gcc releases. > 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. If you are using cachecc or distcc, the question of where GCC lives is somewhat ambiguous in any case. Ian