Re: Understanding how sparse handles multiple input files

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

 



On Wed, Jun 14, 2017 at 10:25:59PM +0100, Dibyendu Majumdar wrote:
> Hi,
> 
> I am trying to understand what happens when multiple input files are
> given to sparse. Are the symbols from previous files dropped when
> sparse moves on to the next file?
> 
> I see a call to remove_symbol_scope() in end_scope() implying that
> symbols are dropped - but then I am not sure I am understanding this
> correctly.

I never yet looked what's happening exactly but I also had seen
a problem when using multiple files, at least a difference
between sparse & gcc. The difference can quickly be seen
with an input file like:
	int a = 1;
	int foo(void) {}
and then call sparse or gcc with twice the same file, like
'sparse $file.c $file.c' or 'gcc -c $file.c $file.c'.

gcc seems to process the files independently and it will simply
overwrite the first $file.o when processing the second one and
this without giving a warning about 'a' or 'foo()' being redefined.

sparse seems to process the files more as if being concatenated
(even if the file scope is respected) or like it would use
a "super-scope" above the file scope of the input files and
will complain that 'a' and 'foo()' are redefined.

Is it something like this you're seeing with multiple input files?


-- Luc Van Oostenryck
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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