ShowPlayerDialog - literal array/string passed to a non-const parameter
#9

Quote:
Originally Posted by SymonClash
Посмотреть сообщение
I don't see the utility of it, probably i'm too ignorant but we lived too even without this errors.
3.10.9 fixes an issue with the compiler where array literals could be modified, which is a thing that should definitely not be able to be done. The checks for detecting attempts to modify array literals do not need to be ran for constant arrays, speeding up the process, and in the discussion it was widely accepted that non-const correct code is bad code in general, therefore this feature was implemented.

Here is some documentation on const correctness (yes, these are two different links):
https://github.com/pawn-lang/compile...st-Correctness
https://github.com/pawn-lang/compile...st-correctness


Quote:
Originally Posted by SymonClash
Посмотреть сообщение
good luck in fixing all this errors, even in native includes.
Const-correct versions of the default includes are available here:
https://github.com/sampctl/pawn-stdlib
https://github.com/sampctl/samp-stdlib

Most actively maintained libraries are also const-corrected by now, including the 5.x branch of YSI.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 4 Guest(s)