digitalmars.D.bugs - [Issue 463] New: private module members have global bindings instead of local ones
- d-bugmail puremagic.com (39/53) Oct 26 2006 http://d.puremagic.com/issues/show_bug.cgi?id=463
- d-bugmail puremagic.com (10/10) Nov 26 2010 http://d.puremagic.com/issues/show_bug.cgi?id=463
- d-bugmail puremagic.com (12/12) Jan 22 2013 http://d.puremagic.com/issues/show_bug.cgi?id=463
http://d.puremagic.com/issues/show_bug.cgi?id=463 Summary: private module members have global bindings instead of local ones Product: D Version: 0.170 Platform: PC OS/Version: Linux Status: NEW Keywords: link-failure Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: thomas-dloop kuehne.cn http://www.digitalmars.com/d/attribute.htmlPrivate means that only members of the enclosing class can access the member, or members and functions in the same module as the enclosing class. Private members cannot be overridden. Private module members are equivalent to static declarations in C programs.=== d.d === private void foo(){ } ====== dmd -c d.d readelf -s d.oSymbol table '.symtab' contains 11 entries: Num: Value Size Type Bind Vis Ndx Name<snip>10: 00000000 5 FUNC GLOBAL DEFAULT 12 _D1a3fooFZv=== c.c === static void foo(){ } ====== gcc -c c.c readelf -s c.oSymbol table '.symtab' contains 11 entries: Num: Value Size Type Bind Vis Ndx Name<snip>5: 00000000 6 FUNC LOCAL DEFAULT 1 fooThis becomes a problem if a private function with C calling convention is defined: === bug.d === private extern(C) void foo(){ } ====== dmd -c bug.dSymbol table '.symtab' contains 11 entries: Num: Value Size Type Bind Vis Ndx Name<snip>10: 00000000 5 FUNC GLOBAL DEFAULT 12 fooThe last line should have been10: 00000000 5 FUNC LOCAL DEFAULT 12 foo--
Oct 26 2006
http://d.puremagic.com/issues/show_bug.cgi?id=463 Andrei Alexandrescu <andrei metalanguage.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED CC| |andrei metalanguage.com AssignedTo|nobody puremagic.com |bugzilla digitalmars.com -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 26 2010
http://d.puremagic.com/issues/show_bug.cgi?id=463 Andrej Mitrovic <andrej.mitrovich gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrej.mitrovich gmail.com 11:06:44 PST --- I could be wrong, but I don't think that "equivalent to static" meant it's equivalent in how the two are emitted to the object, but rather where they can be used from (i.e. from within a single module). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 22 2013