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

Warning 239 everywhere and I can't fix it #527

Closed
vichvich4444 opened this issue May 22, 2020 · 2 comments
Closed

Warning 239 everywhere and I can't fix it #527

vichvich4444 opened this issue May 22, 2020 · 2 comments

Comments

@vichvich4444
Copy link

  • Compiler version: 3.10.10
  • Command line arguments provided (or sampctl version): -D..\gamemodes -d2
  • Operating System: Win10 64bit

When I compile with on latest compiler version I got tons of warning 239: literal array/string passed to a non-const parameter that related to function in .dll file I can't change.

@AmyrAhmady
Copy link
Contributor

related to function in .dll file?
that's a newly added warning message in latest versions of compiler, for const correctness, in order to avoid passing non-const strings or arrays, cause they'll be passed by address and values can be modified.
so in samp-stdlib and pawn-stdlib, functions that does not need that behavior (being passed by reference) have their array/string parameters as const.
Update your samp and pawn includes by using following libraries:
https://github.com/pawn-lang/samp-stdlib
https://github.com/pawn-lang/pawn-stdlib

for other libraries? use latest version, if they are not const corrected, there's probably a const corrected version somewhere on github like easyDialog (https://github.com/Awsomedude/easyDialog/ , not to mention it still has issues and needs to be fixed fully.). if the library you are using is very old and there's no const corrected version, try fixing it yourself, and it would be very nice if you share it with others as well, it would appreciated.

@YashasSamaga
Copy link
Member

@natovan Please reopen if you think the problem persists and the warnings are actually wrong.

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

3 participants