Re: [PATCH] cgcc: accept any file type with '-x c'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 22 Nov 2018 00:19:22 +0100
Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> wrote:

> On Wed, Nov 21, 2018 at 11:44:06PM +0100, Antonio Ospite wrote:
[...]
> > Hi Luc,
> > 
> > this improves things a bit, but there is another issue with -E.
> > 
> > If "-o file" is passed and only $do_check is enabled sparse will
> > ignore the -o option and the preprocessed output will go to the stdout
> > and not in the specified file, as would be expected by a normal gcc
> > invocation.
> 
> Yes, I know. Sparse always ignored the '-o option' but I added a patch
> for it yesterday.
>

Thank you, I didn't see that patch in the git repository and I missed it
on the ml because I am not subscribed, but I found it here
https://marc.info/?l=linux-sparse&m=154270011802037&w=2

It seems to work fine with '-x c' for my use case.
I'll review the patch about '-x c' now and send some minor comments.

Another small addition would be for cgcc to also consume the argument of
"-o" as soon as it finds it, to prevent it from being matched as an
input file; e.g. when running:

	cgcc -E -o output.c input.c.in

as for now, output.c would be matched by

	$do_check = 1 if /^[^-].*\.c$/;

and $do_check would be enabled even though input.c.in does not end
in '.c' and '-x c' is not passed.

Which might as well be what the user want after all, but not what the
code means to do. :)

> > So the question is: does it make sense to run sparse on files which
> > are only preprocessed?
> 
> It really does make sense. The biggest reason is because you want
> to have coherent results between the output of '-E' and sparse's
> pre-processing at checking time (for example, if the code contains
> #ifdef __CHECKER__).
> 

OK, I see, thanks.

Ciao ciao,
   Antonio

-- 
Antonio Ospite
https://ao2.it
https://twitter.com/ao2it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux