Discussion:
[REGRESSION] Support for 'pcc -E -dD -' missing
Thorsten Glaser
2012-09-22 19:16:42 UTC
Permalink
First, an older pcc where it worked:

***@blau:~ $ /usr/mpkg/bin/pcc -v
pcc 1.1.0.DEVEL 20110422 for i386-ecce-mirbsd10, MirPorts:pcc-1.0.999-20110422-0
no input files
8|***@blau:~ $ (:|/usr/mpkg/bin/pcc -E -dD -; echo >&2 ${PIPESTATUS[*]}) | tail -1
0 0
# 1 "<stdin>"

Now, in current pcc, it fails:

***@blau:~ $ /opt/pcc/bin/pcc -v
pcc 1.1.0.DEVEL 20120921 for i386-ecce-mirbsd10
no input files
8|***@blau:~ $ (:|/opt/pcc/bin/pcc -E -dD -; echo >&2 ${PIPESTATUS[*]}) | tail -1
warning: unknown option '-dD'
0 0

That was a rather important option (plus, the exit status is
all wrong), and this regression is bad. Please fix.

Thanks,
//mirabilos
--
"Using Lynx is like wearing a really good pair of shades: cuts out
the glare and harmful UV (ultra-vanity), and you feel so-o-o COOL."
-- Henry Nelson, March 1999
Anders Magnusson
2012-09-22 20:23:04 UTC
Permalink
Post by Thorsten Glaser
pcc 1.1.0.DEVEL 20110422 for i386-ecce-mirbsd10, MirPorts:pcc-1.0.999-20110422-0
no input files
0 0
# 1 "<stdin>"
pcc 1.1.0.DEVEL 20120921 for i386-ecce-mirbsd10
no input files
warning: unknown option '-dD'
0 0
That was a rather important option (plus, the exit status is
all wrong), and this regression is bad. Please fix.
Well, -dD has never been an option in pcc, it just slipped through the
old driver since
there were no checks but it didn't do anything. Now it at least
complains :-)

-- Ragge
Thorsten Glaser
2012-09-22 20:33:11 UTC
Permalink
Well, -dD has never been an option in pcc, it just slipped through the old
driver since
there were no checks but it didn't do anything. Now it at least complains :-)
That's worse due to the exit code 0 despite immediately
returning. (Is it hard to implement an actual -dD ?)

bye,
//mirabilos
--
21:12⎜<Vutral> sogar bei opensolaris haben die von der community so
ziemlich jeden mist eingebaut │ man sollte unices nich so machen das
desktopuser zuviel intresse kriegen │ das macht die code base kaputt
21:13⎜<Vutral:#MirBSD> linux war früher auch mal besser :D
Anders Magnusson
2012-09-23 08:43:49 UTC
Permalink
Post by Thorsten Glaser
Well, -dD has never been an option in pcc, it just slipped through the old
driver since
there were no checks but it didn't do anything. Now it at least complains :-)
That's worse due to the exit code 0 despite immediately
returning. (Is it hard to implement an actual -dD ?)
exit 0 was due to another bug causing - to be ignored as argument, I
just fixed that.
Implement -dD is not trivial.

-- Ragge
Thorsten Glaser
2012-09-23 09:30:35 UTC
Permalink
It was an amd64 define that got checked in by accident. Removed now.
exit 0 was due to another bug causing - to be ignored as argument, I just fixed
that.
OK, thanks. I’ll try to get further then, though need to work
for some €€€ now first.

bye,
//mirabilos
--
<Natureshadow> Dann mach ich git annex copy --to shore und fertig ist das
<Natureshadow> das ist ja viel cooler als ownCloud ...
<mirabilos> sag ich doch
<Natureshadow> ja wieso stimmt das denn immer was du sagst ...
Iain Hibbert
2012-09-23 10:01:55 UTC
Permalink
Post by Thorsten Glaser
Post by Anders Magnusson
Well, -dD has never been an option in pcc, it just slipped through the
old driver since there were no checks but it didn't do anything. Now
it at least complains :-)
That's worse due to the exit code 0 despite immediately
returning.
It issues a warning, but otherwise ignores the option.. should such
warnings cause an exit failure?

I do think it could be beneficial, since although unrelated failures are
immediately found, at least such instances become enumerated :)
Post by Thorsten Glaser
(Is it hard to implement an actual -dD ?)
likely not; does the attached patch work correctly?

In my copy of the gcc info file, there seems to be conflicting
descriptions of the -dD option..

iain
Thorsten Glaser
2012-09-23 10:49:31 UTC
Permalink
Post by Iain Hibbert
Post by Thorsten Glaser
Post by Anders Magnusson
Well, -dD has never been an option in pcc, it just slipped through the
old driver since there were no checks but it didn't do anything. Now
it at least complains :-)
That's worse due to the exit code 0 despite immediately
returning.
It issues a warning, but otherwise ignores the option.. should such
warnings cause an exit failure?
Yes, if some configure script tests for whether the compiler driver
supports it.
Post by Iain Hibbert
Post by Thorsten Glaser
(Is it hard to implement an actual -dD ?)
likely not; does the attached patch work correctly?
Will have to look later.
Post by Iain Hibbert
In my copy of the gcc info file, there seems to be conflicting
descriptions of the -dD option..
It basically passes through all the #define from the original
file instead of stripping them, plus issues #define lines for
all built-in defines. For example, look at these two:

$ : | gcc -E -dD - | less
$ echo '#include <sys/cdefs.h>' | gcc -E -dD - | less

bye,
//mirabilos
--
<Natureshadow> Dann mach ich git annex copy --to shore und fertig ist das
<Natureshadow> das ist ja viel cooler als ownCloud ...
<mirabilos> sag ich doch
<Natureshadow> ja wieso stimmt das denn immer was du sagst ...
Iain Hibbert
2012-09-23 11:19:09 UTC
Permalink
Post by Thorsten Glaser
Post by Iain Hibbert
Post by Thorsten Glaser
Post by Anders Magnusson
Well, -dD has never been an option in pcc, it just slipped through the
old driver since there were no checks but it didn't do anything. Now
it at least complains :-)
That's worse due to the exit code 0 despite immediately
returning.
It issues a warning, but otherwise ignores the option.. should such
warnings cause an exit failure?
Yes, if some configure script tests for whether the compiler driver
supports it.
Post by Iain Hibbert
Post by Thorsten Glaser
(Is it hard to implement an actual -dD ?)
likely not; does the attached patch work correctly?
Will have to look later.
Post by Iain Hibbert
In my copy of the gcc info file, there seems to be conflicting
descriptions of the -dD option..
It basically passes through all the #define from the original
file instead of stripping them, plus issues #define lines for
all built-in defines.
in the documentation for gcc-4.5.3, under -dCHARS it says:

`D'
Like `M' except in two respects: it does _not_ include the
predefined macros, and it outputs _both_ the `#define'
directives and the result of preprocessing. Both kinds of
output go to the standard output file.

but under -dLETTERS it mentions:

`-dD'
Dump all macro definitions, at the end of preprocessing, in
addition to normal output.

so I don't know which is correct.. my patch only supplies the latter, and
I think the former is, as ragge said, much more difficult :)

in fact, my patch does not provide the latter exactly anyway, since the
definitions are dumped _before_ preprocessing (but gcc-4.5.3 seems to do
that too, so I dunno :)

what does this configure script that you have actually expect from that
option?

iain

Loading...