All of lore.kernel.org
 help / color / mirror / Atom feed
* sparse-llvm duplicate declarations of data
@ 2017-03-14 20:29 Dibyendu Majumdar
  2017-03-16 17:25 ` Luc Van Oostenryck
  0 siblings, 1 reply; 2+ messages in thread
From: Dibyendu Majumdar @ 2017-03-14 20:29 UTC (permalink / raw)
  To: Linux-Sparse

Hi,

In the following test case:

static int once;
static int once = 1;
extern int printf(const char *, ...);
static int value(int *p)
{
 return *p;
}
int main(void)
{
 return value(&once) == 1 ? 0 : 1;
}

Sparse-llvm declares the global 'once' twice as there is a check
missing on whether the global has already been defined.

Regards

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: sparse-llvm duplicate declarations of data
  2017-03-14 20:29 sparse-llvm duplicate declarations of data Dibyendu Majumdar
@ 2017-03-16 17:25 ` Luc Van Oostenryck
  0 siblings, 0 replies; 2+ messages in thread
From: Luc Van Oostenryck @ 2017-03-16 17:25 UTC (permalink / raw)
  To: Dibyendu Majumdar; +Cc: Linux-Sparse

On Tue, Mar 14, 2017 at 08:29:46PM +0000, Dibyendu Majumdar wrote:
> Hi,
> 
> In the following test case:
> 
> static int once;
> static int once = 1;
> extern int printf(const char *, ...);
> static int value(int *p)
> {
>  return *p;
> }
> int main(void)
> {
>  return value(&once) == 1 ? 0 : 1;
> }
> 
> Sparse-llvm declares the global 'once' twice as there is a check
> missing on whether the global has already been defined.

Yes, this is a known issue.
It's because sparse doesn't do yet the consolidation of declarations.


-- Luc

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-16 17:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-14 20:29 sparse-llvm duplicate declarations of data Dibyendu Majumdar
2017-03-16 17:25 ` Luc Van Oostenryck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.