----Original Message----
>From: Zack Weinberg
>Sent: 12 April 2005 18:02

> Dimitry Golubovsky <[EMAIL PROTECTED]> writes:
> 
>> Devang,
>> 
>> Thanks for your relpy.
>> 
>> This addresses only compiler's action problem (no output produced),
>> but does not address the stdin problem.
>> 
>> When I try
>> 
>> % cat a.c | gcc -fsyntax-only  -
>> 
>> I get
>> 
>> gcc: -E required when input is from standard input
> 
> In order to run the compiler as well, you have to tell it what
> language it's getting, e.g.
> 
> $ cat a.c | gcc -x c -fsyntax-only -
> 
> Normally this is determined from the file extension, but that's not
> available when reading stdin.  It doesn't matter (much) when running
> the preprocessor, which is why it lets you do that without the -x c.
> 
> zw


  Then the error message *really* ought to say

gcc: -E or -x required when input is from standard input

since it is thoroughly obtuse and non-explanatory as it stands.  The
attached is against 4.0 RC1, but I imagine it'll apply cleanly to HEAD with
just a little fuzz, if people feel it's the right thing.  However, I must be
honest enough to warn that it _is_ untested! :-O  Conceivably it could break
a dg error or warning test, but I couldn't find the phrases "when input" or
"from standard" with "grep -R gcc/testsuite/*", and I eyeballed every
instance of the word "required" in the testsuite, and I couldn't find any
such test.....



2005-12-04  Dave Korn  <[EMAIL PROTECTED]>

        * gcc.c (default_compilers):  Clarify obscure error message.

    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....

Attachment: obscure-error-msg-patch.diff
Description: Binary data

Reply via email to