Bug 6553 - Incorrect warning for private lfun
: Incorrect warning for private lfun
Status: RESOLVED FIXED
: Pike
Compiler
: 7.9
: All All
: P3 (normal) normal
: ---
Assigned To:
:
:
:
  Show dependency treegraph
 
Reported: 2012-10-07 20:23 CET by
Modified: 2012-10-09 14:41 CET (History)
Scrum Prio:
In scrum?: ---
Story included in sprints:
Unplanned in sprints:


Attachments


Description From 2012-10-07 20:23:25 CET
If I make a function like this:

 static private string _sprintf(int mode) { ... }

then the compiler gives me a warning:

 Warning: _sprintf is private but not used anywhere.

But the warning is incorrect.  _sprintf is used as an lfun.
------- Comment #1 From 2012-10-08 10:31:12 CET -------
The warning is correct; private lfuns won't get called.
------- Comment #2 From 2012-10-08 17:57:41 CET -------
Wrong.  private lfuns work just fine:

Pike v7.9 release 5 running Hilfe v3.5 (Incremental Pike Frontend)
> class A { static private string _sprintf(int t) { return "Hello"; }};
Compiler Warning: 1: _sprintf is private but not used anywhere.
> A();
(1) Result: Hello
> 

The only problem is the warning.
------- Comment #3 From 2012-10-09 14:41:22 CET -------
Aha. This is due to a somewhat obscure behavior in
really_low_find_shared_string_identifier(), which returns private symbols even
if not SEE_PRIVATE if the symbol isn't inherited.

Fixed the warning. Private non-lfuns will still be complained about.

Note

You need to log in before you can comment on or make changes to this bug.