Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

static specifier has no effect when only used in function declaration #624

Open
Daniel-Cortez opened this issue Dec 23, 2020 · 2 comments
Open

Comments

@Daniel-Cortez
Copy link
Contributor

Issue description:

Using the static specifier in a new-style function declaration, but omitting it in the definition

// file1.inc
forward static Func();
Func(){}

results in static having no effect on the function, so the latter can be called from other files

// main.pwn
#include "file1.inc"

main()
{
	// This compiles without errors or warnings, even though normally
	// the scope of Func() is expected to be limited to "file1.inc" only,
	// as the function was first declared as "static".
	Func();
}

Minimal complete verifiable example (MCVE):

See above.

Workspace Information:

  • Compiler version: 3.2.3664, 3.10.10
  • Command line arguments provided (or sampctl version):
  • Operating System:
@Daniel-Cortez
Copy link
Contributor Author

Related: #621.

@stale
Copy link

stale bot commented Jun 22, 2021

This issue has been automatically marked as stale because it has not had recent activity.

@stale stale bot added the state: stale label Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant