This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug translator/12586] New: better treatment for confusing $var . field vs. $var->field syntax
- From: "fche at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sourceware dot org
- Date: Tue, 15 Mar 2011 16:52:19 +0000
- Subject: [Bug translator/12586] New: better treatment for confusing $var . field vs. $var->field syntax
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=12586
Summary: better treatment for confusing $var . field vs.
$var->field syntax
Product: systemtap
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: translator
AssignedTo: systemtap@sourceware.org
ReportedBy: fche@redhat.com
C programmers are sometimes confused by systemtap's use of -> for all
context-variable dereferencing, including for struct members. We should
try to improve this. Some possibilities, all to be conditional on
--compatible >= 1.5:
1) make the parser accept $var . foo and turn it into $var->foo
... but if $var is actually a string and foo is another string,
this would break the script. The parser doesn't have enough
information to decide.
2) make the parser warn for $var . foo
... we only have a few test cases for constructs like this, but it
can legitimately occur in $$parms . something
3) make the elaborator (pass-2) look for $var . foo; if the former fails
to resolve, try rewriting to $var->foo and resolve again.
4) something like 3), but only for non-string-valued $var
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.