34 Commits

Author SHA1 Message Date
Y-Less
18b6df7c12
Merge branch 'dev' into __addrof 2019-11-07 01:35:51 +01:00
Y_Less
2f642899f1 Fix #451 2019-09-25 19:44:47 +02:00
Daniel_Cortez
1d3b2319fd Implement operator '__addressof' 2019-09-18 19:50:28 +07:00
Daniel_Cortez
ef49529b50 Symbol suggestions: distinguish native functions and Pawn functions 2019-09-13 19:31:35 +07:00
Daniel_Cortez
303b782517 Fix incorrect suggestions for state variables 2019-06-18 22:00:31 +07:00
Zeex
e645ffceef
Merge pull request #397 from Daniel-Cortez/suggestions-fix
More fixes related to suggestions
2019-06-16 12:48:26 +06:00
Daniel_Cortez
4c8d56c511 __emit: Issue an error if the stack offset/data address is not a multiple of cell size 2019-04-27 23:34:52 +07:00
Daniel_Cortez
e60e2fbb7f sc5.c: Minor adjustments 2019-04-08 01:46:21 +07:00
Daniel_Cortez
d72c58236e Fix Pawn functions not being suggested before the point of their definition/implementation 2018-12-31 21:44:11 +07:00
Daniel_Cortez
b411e5a7bc Switch from symbol subtypes to symbol subtype flags
The new system should be more flexible as it allows to combine symbol subtypes.
2018-12-31 21:44:10 +07:00
Daniel_Cortez
a7c58633db Fix the compiler suggesting unimplemented variables 2018-10-03 20:30:45 +07:00
Zeex
aabd3a5d5d Fix naming and improve test name (#353) 2018-09-29 07:03:58 +06:00
Daniel_Cortez
bc04b2ef04 Show suggestions for mistyped identifiers (#353) 2018-09-29 07:03:44 +06:00
Zeex
16995c5ee1 Whitespace cleanup 2018-08-11 23:12:45 +06:00
Zeex
537c91ab91
Merge pull request #302 from YashasSamaga/fix-i276
suggest `const` qualifier for arguments and inform user when an array/string literal is passed as a non-const argument
2018-06-03 03:36:05 +06:00
Yashas
c363c5b1de add warning for literal passed to non-const parameter
Adds a new warning to warn users when they pass an array/string literal to a non-const qualified parameter.

```
f1(arr[]) {
 	new a = arr[0];
 	#pragma unused a
}

f2(arr[5]) {
    new a = arr[0];
    #pragma unused a
}
f3(const arr[]) {
    new a = arr[0];
    #pragma unused a
}
f4(const arr[5]) {
    new a = arr[0];
    #pragma unused a
}

main () {
	f1("test");
	f2("test");
	f3("test");
	f4("test");

	new arr[5];
	f1(arr);
	f2(arr);
	f3(arr);
	f4(arr);

	f1(arr[0]);
	//f2(arr[0]); - array size must match
	f3(arr[0]);
	//f4(arr[0]); - array size must match
}
```

```
test.pwn(1) : warning 214: possibly a "const" array argument was intended: "arr"
test.pwn(6) : warning 214: possibly a "const" array argument was intended: "arr"
test.pwn(20) : warning 239: literal array/string passed to a non-const parameter
test.pwn(21) : warning 239: literal array/string passed to a non-const parameter
```
2018-05-10 10:44:36 +05:30
Yashas
fd4369e67b debug info for index tagmm warnings
This commit makes the compiler display debug information for "index" tag mismatch warnings.
2018-05-08 09:43:34 +05:30
Zeex
1fbc474543 Merge branch 'improvement-i172' of https://github.com/YashasSamaga/pawn 2018-04-22 19:12:28 +06:00
Yashas
43c4a5f18b user friendly tagmm warnings 2018-01-25 23:18:17 +05:30
Yashas
345b415d55 debug info for tagmismatch warnings
This commit adds useful information to the "tag mismatch" warning.
2018-01-18 21:41:26 +05:30
Yashas
57ef6150ed warning for meaningless class combinations
1. Adds a generic new warning which is triggered when meaningless combination of class specifiers are used.

2. This commit adds code to trigger a warning for the following two cases:
- constant reference
- - not meaningful as as references always point to cells in PAWN (unlike C++ where it would help costly copies while guaranteeing to not modify the object) which makes const reference is as good as pass-by-value
- constant variable arguments
- - for similar reasons as in the previous case
2018-01-12 23:51:35 +05:30
Zeex
9a21fb5a2f Reset errline to -1 instead of 0 2018-01-12 20:33:17 +06:00
Y_Less
f1da832ae9 -E warnings as errors. 2017-10-24 21:18:07 +02:00
Yashas
1efcf90a28 new error msg for returning arrays of unknown size 2017-09-29 16:21:13 +05:30
Zeex
3a4878f54b Fix clang warnings 2017-02-11 19:32:10 +06:00
Double V
7c81e6573d Fix some errors with static enums in a block (#141)
Signed-off-by: VVWVV <d0u61ev@gmail.com>
2017-01-30 00:20:46 +07:00
Zeex
2dd0e8c6af Merge branch 'feature_enum_static' of https://github.com/VVWVV/pawn into VVWVV-feature_enum_static 2017-01-29 02:46:59 +06:00
Zeex
f9e9c181dd Mark symbols as read when they are passed as function arguments
This is an improved version of the earlier fix for bug #131.

Also should fix https://github.com/Misiur/YSI-Includes/issues/154.
2017-01-28 12:59:49 +06:00
VVWVV
6d2aa15a3f #134: Proposal: enum limited to single file scope
Signed-off-by: VVWVV <d0u61ev@gmail.com>
2017-01-23 14:20:33 +03:00
Zeex
25b21eb0aa Improve reparse check
Only reparse if the function has a tagged result (old behavior) or a
global variable is passed as one of its arguments at some point before
declaration/definition.

Also warn if need to reparse so that developers are aware of potential
performance hit.

Fixes #131.
2017-01-22 17:26:14 +06:00
Zeex
867f6902f3 Remove string compression
This removes all scpack-packed strings and moves normal strings from
.scp files to corresponding .c files. The code responding for packing
and unpacking is gone as well.

If you have enough memory to run a SA-MP server you most likely have
more than enough of it to not worry about saving a few additional KBs
of text. Besides, these strings were kind of hard to navigate / edit,
and you could easily forget to regenerate them with scpack (though it
could be automated).
2015-04-06 16:38:08 +06:00
Zeex
634f40953b Introduce #pragma warning
This pragma lets you to enable or disable a specific warning by its
unique number (same as in error messages).

Syntax: #pragma warning (push|pop|enable XXX|disable XXX)

#pragma warning push - save current warnings
#pragma warning pop - restore warnings
#pragma warning enable XXX - enable warning XXX
#pragma warning disable XXX - disable warning XXX
2014-01-05 02:58:42 +07:00
Zeex
6943995219 Fix missing newline in error message 2014-01-04 16:01:31 +07:00
Zeex
766b96bcf3 Lower case directory names 2013-09-19 13:06:46 +07:00