[Bug translator/19624] New: Duplicate function parameter names are not detected

flu at redhat dot com sourceware-bugzilla@sourceware.org
Fri Feb 12 18:54:00 GMT 2016


https://sourceware.org/bugzilla/show_bug.cgi?id=19624

            Bug ID: 19624
           Summary: Duplicate function parameter names are not detected
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
          Assignee: systemtap at sourceware dot org
          Reporter: flu at redhat dot com
  Target Milestone: ---

The following function contains a duplicate parameter name,
namely "x". This duplicate makes it out of the systemtap
translator. The error message could be much cleaner if
it were detected during translation instead of letting the
C compiler detect it. 

function f(x, x) {
  return x;
}

probe begin {
  c = "asd"
  println(f(c, "fgh"))
  exit()
}

Pass 1: parsed user script and 115 library scripts using
216188virt/37324res/7300shr/30328data kb, in 290usr/20sys/304real ms.
Pass 2: analyzed script: 1 probe, 2 functions, 0 embeds, 0 globals using
216980virt/38088res/7560shr/31120data kb, in 0usr/0sys/9real ms.
Pass 3: translated to C into
"/tmp/stap8f92en/stap_e59abc02e1bb7adbf4b1c2670a3e6509_1191_src.c" using
216980virt/38912res/8136shr/31120data kb, in 0usr/0sys/0real ms.
/tmp/stap8f92en/stap_e59abc02e1bb7adbf4b1c2670a3e6509_1191_src.c:52:20: error:
duplicate member ‘l_x’
       const char * l_x;
                    ^
scripts/Makefile.build:258: recipe for target
'/tmp/stap8f92en/stap_e59abc02e1bb7adbf4b1c2670a3e6509_1191_src.o' failed
make[1]: *** [/tmp/stap8f92en/stap_e59abc02e1bb7adbf4b1c2670a3e6509_1191_src.o]
Error 1
Makefile:1388: recipe for target '_module_/tmp/stap8f92en' failed
make: *** [_module_/tmp/stap8f92en] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compiled C into "stap_e59abc02e1bb7adbf4b1c2670a3e6509_1191.ko" in
3900usr/3230sys/6970real ms.
Pass 4: compilation failed.  [man error::pass4]

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Systemtap mailing list