Skip to content
Closed

dev #734

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
340 commits
Select commit Hold shift + click to select a range
9e187d4
Don't increase the compound level for the initialization section in "…
Daniel-Cortez Jun 7, 2020
9212878
Don't forget to demote the level of assignments if both `if` branches…
Daniel-Cortez Jun 7, 2020
fbd0442
Detect unused assignments in the "true" "if" branch if there's a "fal…
Daniel-Cortez Jun 8, 2020
3640658
Also detect unused assignments in all "switch" branches
Daniel-Cortez Jun 8, 2020
ce6f712
Clean up assignments to "passed-by-reference" function arguments on `…
Daniel-Cortez Jun 8, 2020
143af68
Merge `restoreassignments()` and `demoteassignments()` into one function
Daniel-Cortez Jun 9, 2020
c69e822
Add new test cases
Daniel-Cortez Jun 9, 2020
ad427d9
Remove the symbol table argument from functions `clearassignments()`,…
Daniel-Cortez Jun 10, 2020
458e387
Do not set the `uASSIGNED` flag for global variables
Daniel-Cortez Jun 10, 2020
dbd1205
Add a check for `tagof`
Daniel-Cortez Jul 10, 2020
b6e18d9
Avoid a fatal error when the argument of `sizeof`/`tagof` used for a …
Daniel-Cortez Jul 10, 2020
f8bb286
Update the tests
Daniel-Cortez Jul 10, 2020
4d41677
Fix `const` being applied only to the highest array dimension
Daniel-Cortez Jul 24, 2020
c8192ee
Add tests
Daniel-Cortez Jul 24, 2020
b9dcc00
Fix NULL pointer dereference when a state function is defined with ar…
Daniel-Cortez Aug 7, 2020
43ee7e1
Add tests
Daniel-Cortez Aug 7, 2020
93bf118
Fix bad code generation when returning an array returned by another f…
Daniel-Cortez Sep 3, 2020
700cfb0
Add tests
Daniel-Cortez Sep 3, 2020
f4a7a5a
Fix heap space being leaked when there are multiple comma-separated e…
Daniel-Cortez Sep 4, 2020
cacc196
Update the tests
Daniel-Cortez Sep 4, 2020
c1bacd3
Remove redundant variable declaration
Daniel-Cortez Sep 5, 2020
3d0ca32
Reset variable "overflow" when the warning has been shown, so it won'…
Daniel-Cortez Sep 16, 2020
e745104
Update tests
Daniel-Cortez Sep 16, 2020
1c9c160
Merge remote-tracking branch 'remotes/Daniel-Cortez/fix-531'
Y-Less Sep 19, 2020
a7dda01
Merge remote-tracking branch 'remotes/Daniel-Cortez/fix-542'
Y-Less Sep 19, 2020
070ec05
Merge remote-tracking branch 'remotes/Daniel-Cortez/wshift-count'
Y-Less Sep 19, 2020
9158030
Merge remote-tracking branch 'remotes/Daniel-Cortez/wswitch-constexpr'
Y-Less Sep 19, 2020
c4c3083
Merge remote-tracking branch 'remotes/Daniel-Cortez/tagof-tag-argdefa…
Y-Less Sep 19, 2020
1ec2033
Merge remote-tracking branch 'remotes/Daniel-Cortez/fix-553'
Y-Less Sep 19, 2020
313b071
Add tests
Daniel-Cortez Jun 17, 2020
3d792ca
Merge remote-tracking branch 'remotes/Daniel-Cortez/fix-557'
Y-Less Sep 19, 2020
34a9ca7
Merge remote-tracking branch 'remotes/Daniel-Cortez/fix-293'
Y-Less Sep 19, 2020
d5e1cc8
Merge remote-tracking branch 'remotes/Daniel-Cortez/fix-536'
Y-Less Sep 19, 2020
96a5e32
Extra test for literals with `++`.
Y-Less Sep 19, 2020
1c0a570
Merge remote-tracking branch 'remotes/Daniel-Cortez/w240'
Y-Less Sep 19, 2020
f3cddf3
Merge remote-tracking branch 'remotes/Daniel-Cortez/wswitch-enum-cove…
Y-Less Sep 19, 2020
ab66969
Allow `__pragma` to be used as a standalone statement
Daniel-Cortez Sep 19, 2020
54c30d4
Merge remote-tracking branch 'remotes/Daniel-Cortez/__pragma'
Y-Less Sep 19, 2020
df2c34c
Fix `__pragma("naked")` erasing the `flagDEPRECATED` flag
Daniel-Cortez Sep 19, 2020
fe65d89
Update tests
Daniel-Cortez Sep 19, 2020
555027f
Merge remote-tracking branch 'remotes/Daniel-Cortez/__pragma'
Y-Less Sep 20, 2020
1018c36
Merge remote-tracking branch 'remotes/Daniel-Cortez/error-094' into dev
Y-Less Sep 20, 2020
0340313
Add a P-code test for `__pragma`
Daniel-Cortez Sep 20, 2020
0898fa6
New warning: "enum increment has no effect on zero value"
Daniel-Cortez Sep 21, 2020
c6e66dc
Show the new warning only once per enum
Daniel-Cortez Sep 21, 2020
5ba886c
Print warning 242 only when the increment (shift counter) is non-zero…
Daniel-Cortez Sep 21, 2020
2cd7121
Update tests
Daniel-Cortez Sep 21, 2020
d9ab1f5
Compare the contents of default arrays between function declaration(s…
Daniel-Cortez Aug 8, 2020
4ec1f72
Add tests
Daniel-Cortez Aug 8, 2020
e199695
Fix `sizeof` being used on a pointer
Daniel-Cortez Jun 10, 2020
5760dcb
Fix potential pointer truncation on 64-bit systems for the "-H" param…
Daniel-Cortez Jun 10, 2020
d92482a
Fix incorrect pointer comparisons with `0` instead of `NULL`
Daniel-Cortez Jun 10, 2020
4e84702
Replace `0`/`1` with `false`/`true` in `flooreddiv()` calls
Daniel-Cortez Jun 17, 2020
3fa242d
Fix inconsistent parameter naming between function declarations and i…
Daniel-Cortez Jun 18, 2020
2bf025b
Use `FALSE`/`TRUE` instead of `0`/`1` for boolean variables
Daniel-Cortez Jun 20, 2020
e445e54
sc6.c: Fix invalid use of macro `aligncell`
Daniel-Cortez Sep 5, 2020
ba076eb
Detect unreachable code if both branches of the preceding `if` statem…
Daniel-Cortez Jun 10, 2020
cdfe013
Add tests
Daniel-Cortez Aug 17, 2020
8d37862
Also detect unreachable code when `switch` has a default case and all…
Daniel-Cortez Jun 11, 2020
23c6000
Update tests
Daniel-Cortez Aug 17, 2020
c15df94
Don't print warning 209 ("function should return a value") in the fol…
Daniel-Cortez Jun 12, 2020
7b2a7b4
Update tests
Daniel-Cortez Aug 17, 2020
1f6a496
Fix false detection of unreachable code when the `true` `if` branch e…
Daniel-Cortez Jul 3, 2020
dbd7933
Update tests
Daniel-Cortez Aug 17, 2020
75c55c8
Detect unreachable code after `goto`
Daniel-Cortez Jul 24, 2020
75ccb80
Update tests
Daniel-Cortez Aug 17, 2020
7c65fa3
Fix labels being falsely reported as unreachable when they were previ…
Daniel-Cortez Aug 17, 2020
bb850c6
Update tests
Daniel-Cortez Aug 18, 2020
2daffd4
Clarify the description for `tTERMINAL`
Daniel-Cortez Aug 18, 2020
bf092b3
Don't warn about unreachable code if a `return` statement has a const…
Daniel-Cortez Aug 18, 2020
cad22e9
Update tests
Daniel-Cortez Aug 18, 2020
72ad325
Treat `exit` statements as terminal
Daniel-Cortez Aug 19, 2020
1ffaca3
Update tests
Daniel-Cortez Aug 19, 2020
28cf451
Don't show the new warning when it's caused by overflow
Daniel-Cortez Sep 25, 2020
6d5dce1
Add tests
Daniel-Cortez Sep 25, 2020
160f62c
Update the enum increment test not to trigger warning 245.
Daniel-Cortez Sep 25, 2020
0df6f21
New warning: "multiplication overflow in enum item declaration"
Daniel-Cortez Sep 28, 2020
ff9a380
Add tests
Daniel-Cortez Sep 28, 2020
15f6878
Return the '\n' symbol that was previously removed by accident
Daniel-Cortez Sep 28, 2020
389b13d
Warn when an empty enum root symbol gets redefined
Daniel-Cortez Sep 29, 2020
1c2b765
Properly handle "enum root" symbols being redefined by enum elements
Daniel-Cortez Sep 29, 2020
ea87f9d
Remove redundant code from `decl_enum()`
Daniel-Cortez Sep 29, 2020
d621b85
Add tests
Daniel-Cortez Sep 29, 2020
44901b2
"enum item" => "enum element"
Daniel-Cortez Sep 30, 2020
5cf8787
"semicolumn" => "semicolon"
Daniel-Cortez Sep 30, 2020
2405fc9
Fix potential truncation of usage flags
Daniel-Cortez Sep 30, 2020
f890bd0
Add a constant for the "bool" tag and use it instead of hardcoded "1"
Daniel-Cortez Oct 1, 2020
9e63fb1
Use the `BOOLTAG` constant instead of calling `pc_addtag("bool")`
Daniel-Cortez Oct 1, 2020
7951c55
Do not track unused assignments for static local variables
Daniel-Cortez Oct 2, 2020
ffac185
Update tests
Daniel-Cortez Oct 2, 2020
fcffb39
Rename `sOPTIMIZE_DEFAULT` into `sOPTIMIZE_FULL`
Daniel-Cortez Oct 3, 2020
8dd861a
Make more function declarations C89-compliant
Daniel-Cortez Oct 3, 2020
7e16b5f
New warning: `use of operator "~" on a "bool:" value always results i…
Daniel-Cortez Oct 2, 2020
7a19c37
Add tests
Daniel-Cortez Oct 2, 2020
351a8ee
New diagnostic: `possible misuse of comma operator`
Daniel-Cortez Oct 4, 2020
988f910
Add tests
Daniel-Cortez Oct 4, 2020
d8e78ed
Update the tests for warning 248
Daniel-Cortez Oct 4, 2020
78e8a37
Don't carry the sign bit when casting the symbol usage flags from `in…
Daniel-Cortez Oct 7, 2020
b971a19
`__pragma`: Warn on extra characters after "unused", "unread", "unwri…
Daniel-Cortez Oct 14, 2020
362d298
Simplify the code for `#pragma warning enable/disable`
Daniel-Cortez Oct 14, 2020
4984a48
Use named constants to enable/disable/toggle warnings, instead of har…
Daniel-Cortez Oct 14, 2020
c1cb9a3
`__pragma`: Fix "error 001: expected token: "-string-", but found "!"…
Daniel-Cortez Oct 14, 2020
24dfcba
Implement `__pragma("warning")`
Daniel-Cortez Oct 14, 2020
1d881b2
Update tests
Daniel-Cortez Oct 14, 2020
da08421
Better (fionacci) buffer growth.
Y-Less Oct 16, 2020
ae8968b
Make `""` strings ignore new lines.
Y-Less Oct 16, 2020
3820c64
Multi-line tests.
Y-Less Oct 16, 2020
cd29fad
Add new built-in constant `__timestamp`
Daniel-Cortez Oct 20, 2020
ba89e35
Make `pawnruns` use `amxString` as a built-in module
Daniel-Cortez Oct 20, 2020
263625d
Add tests
Daniel-Cortez Oct 20, 2020
25c816a
Make certain commands raw strings.
Y-Less Oct 20, 2020
fab5a57
Fix raw errors not having multi-line strings.
Y-Less Oct 20, 2020
c97aa00
Merge remote-tracking branch 'remotes/DanielCortez/__pragma' into dev
Y-Less Oct 20, 2020
aa8a3de
Merge remote-tracking branch 'remotes/DanielCortez/__timestamp' into dev
Y-Less Oct 20, 2020
fbf9071
Merge remote-tracking branch 'remotes/DanielCortez/__pragma-warning' …
Y-Less Oct 20, 2020
7ea9934
Merge remote-tracking branch 'remotes/DanielCortez/w240' into dev
Y-Less Oct 20, 2020
fc0dee1
Merge remote-tracking branch 'remotes/DanielCortez/new-diagnostics' i…
Y-Less Oct 20, 2020
f6e390e
Merge remote-tracking branch 'remotes/DanielCortez/misc-fixes' into dev
Y-Less Oct 20, 2020
6a1c334
Merge remote-tracking branch 'remotes/DanielCortez/wshift-count' into…
Y-Less Oct 20, 2020
615353c
Merge remote-tracking branch 'remotes/DanielCortez/array-defvalue-fix…
Y-Less Oct 20, 2020
270f1f3
Merge remote-tracking branch 'remotes/DanielCortez/fix-403' into dev
Y-Less Oct 20, 2020
7e795bd
Fix assertion failure in certain erroneous scenarios
Daniel-Cortez Oct 21, 2020
acdb7d8
Properly parse the array index sub-expression when the array symbol o…
Daniel-Cortez Oct 22, 2020
6ddaac3
Add tests
Daniel-Cortez Oct 22, 2020
b6e06a5
Make `symbol_cache_add()` add symbols with the same name into the sta…
Daniel-Cortez Oct 27, 2020
fa9de0a
Add tests
Daniel-Cortez Oct 26, 2020
9103366
Skim through the case values when there's a case outside of switch
Daniel-Cortez Oct 27, 2020
75ac8f7
Add tests
Daniel-Cortez Oct 27, 2020
e5efb9f
Do not erase the code for the whole expression when the last comma-se…
Daniel-Cortez Nov 2, 2020
97845d4
Add tests
Daniel-Cortez Nov 2, 2020
aaf52ab
Print error 010 when keyword `stock` is used in a local variable decl…
Daniel-Cortez Nov 5, 2020
ac48452
Add tests
Daniel-Cortez Nov 5, 2020
3d36ce6
Print warning 244 ("enum element not handled in switch") at the line …
Daniel-Cortez Nov 6, 2020
818d0ec
Update tests
Daniel-Cortez Nov 6, 2020
466e691
Remove unused variable
Daniel-Cortez Nov 6, 2020
cb4d712
Change the return type of `pc_pushwarnings()` and `pc_popwarnings()` …
Daniel-Cortez Nov 10, 2020
8e834d5
Print an error when `#pragma warning pop` is used more times than `#p…
Daniel-Cortez Nov 10, 2020
6d86515
Fix `#pragma warning enable` not working properly because of `str` ge…
Daniel-Cortez Nov 11, 2020
52ec71c
Properly initialize and clean up the warning stack
Daniel-Cortez Nov 11, 2020
c593a4b
Error when there's no matching `#pragma warning pop`
Daniel-Cortez Nov 12, 2020
c072de0
Add tests
Daniel-Cortez Nov 12, 2020
eee2041
Merge remote-tracking branch 'remotes/DanielCortez/w244' into dev
Y-Less Nov 18, 2020
c667cde
Merge remote-tracking branch 'remotes/DanielCortez/fix-603' into dev
Y-Less Nov 18, 2020
f27ef75
Merge remote-tracking branch 'remotes/DanielCortez/fix-96' into dev
Y-Less Nov 18, 2020
dbc7ff9
Merge remote-tracking branch 'remotes/DanielCortez/fix-597' into dev
Y-Less Nov 18, 2020
612b2b9
Merge remote-tracking branch 'remotes/DanielCortez/fix-594' into dev
Y-Less Nov 18, 2020
c05c770
Merge remote-tracking branch 'remotes/DanielCortez/unreachable-code' …
Y-Less Nov 18, 2020
4bd312d
Merge remote-tracking branch 'remotes/DanielCortez/fix-574' into dev
Y-Less Nov 18, 2020
e754eba
Merge branch 'Branch_multiline' into dev
Y-Less Nov 19, 2020
67ac243
Fix raw error test.
Y-Less Nov 19, 2020
c9ad518
Add multiline string length tests.
Y-Less Nov 19, 2020
6d27bff
Fix use of `0`/`1` instead of `FALSE`/`TRUE`
Daniel-Cortez Oct 27, 2020
640aadb
Move array `sc_tokens` from sc2.c to scvars.c and add a declaration f…
Daniel-Cortez Oct 31, 2020
e7e648f
Fix incompatible pointer type being passed to function `number()`
Daniel-Cortez Nov 5, 2020
6f1817b
Fix invalid token index
Daniel-Cortez Nov 5, 2020
8b53b26
Fix variables shadowing outer variables, remove redundant variable de…
Daniel-Cortez Nov 5, 2020
d5ab9f0
Fix unused assignment at initialization
Daniel-Cortez Nov 6, 2020
dfaff28
Remove unused `uPREDEF` flag
Daniel-Cortez Nov 10, 2020
4b4319a
Get rid of function `finddepend()`
Daniel-Cortez Nov 10, 2020
c9b2945
Rename "warning_047.pwn/meta" to "error_047.pwn/meta"
Daniel-Cortez Nov 10, 2020
4a4ba1e
Fix the character conversion loop relying on a 4-byte cell size
Daniel-Cortez Nov 14, 2020
3a9cfd8
__pragma: Check if the option string is packed/unpacked in a more rel…
Daniel-Cortez Nov 14, 2020
dc78935
Use `duplicatestring()` instead of `strdup()`
Daniel-Cortez Nov 14, 2020
d4cb7cc
Extend warning 247 to other arithmetic and comparison operators
Daniel-Cortez Nov 16, 2020
25b3fd0
Update tests
Daniel-Cortez Nov 16, 2020
67a5cab
Fix clang warnings
Daniel-Cortez Nov 19, 2020
55d8932
Indentation fix
Daniel-Cortez Dec 6, 2020
98c5217
Fix potential NULL pointer dereferences
Daniel-Cortez Dec 6, 2020
a68bacf
Remove unreachable `return` statements
Daniel-Cortez Dec 6, 2020
3dfad1f
__pragma: Move the string processing code into a separate function, s…
Daniel-Cortez Nov 14, 2020
903c062
Implement operators `__static_assert` and `__static_check`
Daniel-Cortez Oct 13, 2020
46149d1
Add tests
Daniel-Cortez Nov 13, 2020
8970ad2
Implement recording of tokens read by `lex()`
Daniel-Cortez Dec 6, 2020
3d02bfa
Use the newly implemented token recording mechanism to record express…
Daniel-Cortez Dec 6, 2020
58c8692
Update tests
Daniel-Cortez Dec 6, 2020
101205e
Test overloaded `bool:`-tagged operators
Daniel-Cortez Dec 11, 2020
bbcddab
Fix `user_inc()` and `user_dec()` getting merged into one function in…
Daniel-Cortez Jan 3, 2021
a1165ac
Fix the use of `0` instead of `FALSE`
Daniel-Cortez Jan 3, 2021
deec15f
Turn array-size-related assertions into compile-time checks
Daniel-Cortez Jan 3, 2021
712b6a7
Remove the description for already removed flag "uPREDEF"
Daniel-Cortez Jan 5, 2021
781d516
Check if the entry function is actually defined, not only declared
Daniel-Cortez Jan 6, 2021
cce6d87
Add tests
Daniel-Cortez Jan 6, 2021
759f707
Add missing entry point into the "multiline_string_sizes" test
Daniel-Cortez Jan 6, 2021
5fe4480
Ignore state specifications on old-style forward declarations
Daniel-Cortez Sep 29, 2019
3b04173
Fix typo in the description for `constvalue::index`
Daniel-Cortez Jan 8, 2021
c9d2acb
Add tests
Daniel-Cortez Jan 8, 2021
355b324
Skip warning ID 249
Daniel-Cortez Jan 30, 2021
0b721bf
Reformat struct "assigninfo" into "symstate", so it could be used to …
Daniel-Cortez Oct 17, 2020
c93336c
Do not erase code for fetching the value from variable arguments of `…
Daniel-Cortez Feb 27, 2021
f545d8f
Update P-code tests
Daniel-Cortez Feb 28, 2021
3901a61
Simplify the code even more
Daniel-Cortez Feb 28, 2021
583836f
Remove `SC_FASTCALL` from the headers for `emit_*` functions
Daniel-Cortez Feb 28, 2021
e8346c0
Add forward declarations for `emit_*` functions at the beginning of s…
Daniel-Cortez Feb 28, 2021
b849d61
Do not use `errorset()` in `emit_*` functions
Daniel-Cortez Mar 4, 2021
bb3f8c8
Do not modify `errstart` inside function `error()`, use a local varia…
Daniel-Cortez Mar 6, 2021
44a8c5c
Fix wrongly printed starting line number for one of the warnings in `…
Daniel-Cortez Mar 6, 2021
74bb2b3
Add tests
Daniel-Cortez Mar 6, 2021
3706859
__emit: Use proper search criterion for global variables
Daniel-Cortez Aug 3, 2019
647cd34
__emit: Switch to the code segment when used outside functions
Daniel-Cortez Aug 6, 2019
05dcdc1
Fix misleading closing comments
Daniel-Cortez Mar 13, 2021
cb6005e
Fix typos discovered with codespell
Daniel-Cortez Mar 23, 2021
99304f5
Pass variadic array cell arguments by temporarily storing them on the…
Daniel-Cortez Apr 18, 2021
4215694
Add tests
Daniel-Cortez Apr 18, 2021
e0cde05
Warn when variables used inside of a loop condition aren't modified i…
Daniel-Cortez Oct 7, 2020
7d1b6c9
Disable the new diagnostics when a function or an array is used insid…
Daniel-Cortez Oct 18, 2020
ae30cfb
Add tests
Daniel-Cortez Oct 18, 2020
bff0307
Disable warnings 250 and 251 when a global variable is used inside a …
Daniel-Cortez Jan 30, 2021
59c6de1
Update tests
Daniel-Cortez Jan 30, 2021
48c1079
Don't count function arguments passed by const reference as modified
Daniel-Cortez Jan 31, 2021
e137b1c
Add two more test cases to make sure passed-by-reference function arg…
Daniel-Cortez Jan 31, 2021
1951308
Make the new diagnostics actually work on `do-while` loops
Daniel-Cortez Jan 31, 2021
64b2cda
Update tests
Daniel-Cortez Jan 31, 2021
e97a67a
Merge remote-tracking branch 'remotes/Daniel-Cortez/misc-fixes' into dev
Y-Less May 2, 2021
685b691
Merge remote-tracking branch 'remotes/Daniel-Cortez/fix-629' into dev
Y-Less May 2, 2021
85814e7
Merge remote-tracking branch 'remotes/Daniel-Cortez/fix-632' into dev
Y-Less May 2, 2021
74004e4
Merge remote-tracking branch 'remotes/Daniel-Cortez/fix-398' into dev
Y-Less May 2, 2021
001f483
Merge remote-tracking branch 'remotes/Daniel-Cortez/warning-247' into…
Y-Less May 2, 2021
6781afe
Merge remote-tracking branch 'remotes/Daniel-Cortez/loop-diagnostics'…
Y-Less May 2, 2021
5bcc7b4
Merge remote-tracking branch 'remotes/Daniel-Cortez/codespell' into dev
Y-Less May 2, 2021
9440d80
Merge remote-tracking branch 'remotes/Daniel-Cortez/__emit' into dev
Y-Less May 2, 2021
a455d47
Merge remote-tracking branch 'remotes/Daniel-Cortez/fix-642' into dev
Y-Less May 2, 2021
1488c26
Move the remaining declaration in sc1.c
Daniel-Cortez Aug 29, 2020
5bce870
Add tests
Daniel-Cortez Aug 29, 2020
4f82dc9
Merge branch 'Branch_e74b8bb2' into dev
Y-Less May 2, 2021
00a8fbe
Merge remote-tracking branch 'remotes/Daniel-Cortez/static_assert' in…
Y-Less May 2, 2021
d266203
`2.10.11` in preparation...
Y-Less May 2, 2021
b6dd216
Fix sampctl link (#671)
pkfln Aug 17, 2021
92b185f
Use GitHub-flavored Markdown to highlight the MCVE code in the issue …
Daniel-Cortez Sep 29, 2021
6825fb5
Add codepage translation files.
Jan 17, 2022
454fb20
Fix a bug with empty global pawndoc:
Mar 7, 2022
e678be8
Treat explicit zero array size as an error
Daniel-Cortez Sep 30, 2021
940335d
Add tests
Daniel-Cortez Sep 30, 2021
71ba8d2
Use GitHub-flavored Markdown to highlight the MCVE code in the issue …
Daniel-Cortez Sep 29, 2021
1e42633
Fix build errors on Linux and OS X
Daniel-Cortez May 4, 2021
2be8198
Remove excess trailing whitespaces
Daniel-Cortez May 4, 2021
6649bd5
Fix assertion failures for native functions returning arrays
Daniel-Cortez May 5, 2021
33922d4
Add tests
Daniel-Cortez May 5, 2021
afe6f9a
Do not ignore return array size specifications in operator declaratio…
Daniel-Cortez Oct 9, 2021
37c4f79
Add tests
Daniel-Cortez Oct 9, 2021
d87fb6c
Turn `reportname` into a global variable
Daniel-Cortez May 8, 2021
f52a4ce
Allow a combination of `const static` to declare constants limited to…
Daniel-Cortez May 23, 2021
808720b
Add tests
Daniel-Cortez May 23, 2021
de84898
Modify the tests to make sure `const_val` is actually a compile-time …
Daniel-Cortez Feb 2, 2022
c724dc1
Add ".pwn" to the official list of extensions.
Y-Less Mar 11, 2022
d606c91
Merge remote-tracking branch 'remotes/DanielCortez/issue-template' in…
Mar 15, 2022
58d1b37
Merge remote-tracking branch 'remotes/origin/add-pwn' into dev
Mar 15, 2022
07ad8e8
Don't print `fatal error 111:` for user errors/warnings.
Mar 31, 2022
d7a093f
Starting -O2 upgrades
Jun 7, 2022
81b4a02
type mismatch fix.
Nov 14, 2022
4c4ed6d
Fix preprocessor hanging indefinitely when running #include on WSL
JLWalsh Aug 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Learn more about writing MCVE from [StackOverflow](https://stackoverflow.com/hel
If this section is not relevant, feel free to remove this section from your issue.
-->

```
```Pawn
```

<!-- comments on the code, if any -->
Expand Down
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM ubuntu:eoan AS compiler-build

RUN apt-get update && \
dpkg --add-architecture i386 && \
apt-get install -y gcc \
gcc-multilib \
make \
cmake \
git \
python3.8

WORKDIR /home
ADD . /home/pawn
COPY ./build.sh /home/build.sh
RUN mkdir build
RUN /home/build.sh
WORKDIR /home/build

CMD ["/bin/bash"]

FROM ubuntu:eoan AS compiler
RUN mkdir /home/compiler
RUN mkdir /home/build
WORKDIR /home/build
COPY --from=compiler-build /home/build/pawncc .
COPY --from=compiler-build /home/build/pawnruns .
COPY --from=compiler-build /home/build/pawndisasm .
COPY --from=compiler-build /home/build/libpawnc.so .
WORKDIR /home
ADD ./copy.sh /home

CMD /bin/bash
7 changes: 7 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

cd build && \
cmake ../pawn/source/compiler \
-DCMAKE_C_FLAGS=-m32 \
-DCMAKE_BUILD_TYPE=Release && \
make
3 changes: 3 additions & 0 deletions copy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

cp -r /home/build /home/compiler
10 changes: 10 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: '3.7'

services:
compiler:
build: .
stdin_open: true
tty: true
restart: 'no'
volumes:
- ${PWD}/compiler:/home/compiler
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ seems to be based on an older release of Pawn.
[artifacts]:
https://ci.appveyor.com/project/Southclaws/compiler/branch/master/artifacts
[compat]: https://github.com/pawn-lang/compiler/wiki/Compatibility-mode
[sampctl]: http://bit.ly/sampctl
[sampctl]: https://github.com/Southclaws/sampctl
[contributing]:
https://github.com/pawn-lang/compiler/tree/master/.github/CONTRIBUTING.md
[build_source]: https://github.com/pawn-lang/compiler/wiki/Building-From-Source
2 changes: 2 additions & 0 deletions source/amx/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
project(pawnamx C)
cmake_minimum_required(VERSION 2.8)

set_property(GLOBAL PROPERTY USE_FOLDERS ON)

# check for optional include files
include(CheckIncludeFile)
check_include_file("unistd.h" HAVE_UNISTD_H)
Expand Down
1 change: 1 addition & 0 deletions source/amx/amx.c
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,7 @@ static int amx_BrowseRelocate(AMX *amx)

amx->flags &= ~AMX_FLAG_BROWSE;
amx->flags |= AMX_FLAG_RELOC;
amx->flags |= AMX_FLAG_SYSREQD;
if (sysreq_flg & 0x02)
amx->flags |= AMX_FLAG_SYSREQN;
return AMX_ERR_NONE;
Expand Down
12 changes: 8 additions & 4 deletions source/amx/amx.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@
#endif
#endif

#if !defined arraysize
#define arraysize(array) (sizeof(array) / sizeof((array)[0]))
#endif
#if !defined assert_static
/* see "Compile-Time Assertions" by Ralf Holly,
* C/C++ Users Journal, November 2004
Expand Down Expand Up @@ -155,10 +152,16 @@ extern "C" {
* this number needs to be incremented.
* The file version supported by the JIT may run behind MIN_AMX_VERSION. So
* there is an extra constant for it: MAX_FILE_VER_JIT.
*
* For open.mp the file and AMX versions are different, to detect files built
* with the new compiler and `-O2`. This prevents code compiled on the old
* compiler using `-O2`, despite the fact that they are the same. Assembly code
* written on the old compiler can't use the macro ops, and can't detect when
* `-O2` is being used, so a lot of code breaks in that case.
*/
#define CUR_FILE_VERSION 9 /* current file version; also the current AMX version */
#define MIN_FILE_VERSION 6 /* lowest supported file format version for the current AMX version */
#define MIN_AMX_VERSION 9 /* minimum AMX version needed to support the current file format */
#define MIN_AMX_VERSION 10 /* minimum AMX version needed to support the current file format */
#define MAX_FILE_VER_JIT 8 /* file version supported by the JIT */
#define MIN_AMX_VER_JIT 8 /* AMX version supported by the JIT */

Expand Down Expand Up @@ -351,6 +354,7 @@ enum {
#define AMX_FLAG_COMPACT 0x04 /* compact encoding */
#define AMX_FLAG_SLEEP 0x08 /* script uses the sleep instruction (possible re-entry or power-down mode) */
#define AMX_FLAG_NOCHECKS 0x10 /* no array bounds checking; no BREAK opcodes */
#define AMX_FLAG_SYSREQD 0x400 /* SYSREQ.D is NOT used */
#define AMX_FLAG_SYSREQN 0x800 /* script new (optimized) version of SYSREQ opcode */
#define AMX_FLAG_NTVREG 0x1000 /* all native functions are registered */
#define AMX_FLAG_JITC 0x2000 /* abstract machine is JIT compiled */
Expand Down
5 changes: 4 additions & 1 deletion source/compiler/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
project(pawnc C)
cmake_minimum_required(VERSION 2.8)

set_property(GLOBAL PROPERTY USE_FOLDERS ON)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake)

set(VERSION_MAJOR 3)
set(VERSION_MINOR 10)
set(VERSION_BUILD 10)
set(VERSION_BUILD 11)
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_BUILD})
set(VERSION_STR ${VERSION})
math(EXPR VERSION_INT "${VERSION_MAJOR} << 8 | ${VERSION_MINOR}")
Expand Down Expand Up @@ -174,6 +176,7 @@ if(BUILD_TESTING)
../amx/amxaux.h
../amx/amxcons.c
../amx/amxcore.c
../amx/amxstring.c
)
if(UNIX)
set(PAWNRUNS_SRCS
Expand Down
Loading