Bug 23735 – 'extern' storage class affects function declarations

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-02-24T06:28:48Z
Last change time
2024-12-13T19:27:23Z
Assigned to
No Owner
Creator
Max Samukha
Moved to GitHub: dmd#20235 →

Comments

Comment #0 by maxsamukha — 2023-02-24T06:28:48Z
extern void foo(); // passes if 'extern' is removed void foo(); void foo() {} void main() { foo(); } onlineapp.d(13): Error: `a.foo` called with argument types `()` matches both: onlineapp.d(6): `a.foo()` and: onlineapp.d(9): `a.foo()` Applying 'extern' to a function should either be an error or have no effect.
Comment #1 by razvan.nitu1305 — 2023-02-24T12:43:41Z
What does extern do for functions? Can't we just deprecate it?
Comment #2 by razvan.nitu1305 — 2023-02-24T12:45:01Z
I mean, https://dlang.org/spec/declaration.html#extern doesn't offer any function examples and it states: "The primary usefulness of Extern Declarations is to connect with global variables declarations and functions in C or C++ files.". But I don't see how extern (not extern(linkage)) is used to do that.
Comment #3 by robert.schadek — 2024-12-13T19:27:23Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20235 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB