pawn-lang / compiler Goto Github PK
View Code? Open in Web Editor NEWPawn compiler for SA-MP with bug fixes and new features - runs on Windows, Linux, macOS
License: Other
Pawn compiler for SA-MP with bug fixes and new features - runs on Windows, Linux, macOS
License: Other
There's "#error", I'd love a warning equivalent, but I realise that's not really a "fix".
pawncc: /root/pawn/source/compiler/sc6.c:761: assemble: Assertion `numnatives==ntv_funcid' failed.
To recreate:
wget http://slice-vps.nl/pawn-assertion-fail.tar.gz
tar -xf pawn-assertion-fail.tar.gz
pawncc -\; -\( -d2 -i/path/to/include introspect_demo.pwn
Pawn compiler 3.2.3664.samp Copyright (c) 1997-2006, ITB CompuPhase
/root/include/a_http.inc(22) : error 021: symbol already defined: "HTTP"
/root/include/YSI/internal/y_version.inc(194) : error 021: symbol already defined: "YVers_Callback"
/root/include/YSI/y_scripting.inc(86) : warning 219: local variable "addr" shadows a variable at a preceding level
/root/include/YSI/y_scripting.inc(109) : warning 219: local variable "addr" shadows a variable at a preceding level
/root/include/YSI/y_scripting.inc(299) : warning 219: local variable "addr" shadows a variable at a preceding level
/root/include/YSI/y_scripting.inc(452) : warning 219: local variable "addr" shadows a variable at a preceding level
/root/include/YSI/y_scripting.inc(571) : warning 219: local variable "addr" shadows a variable at a preceding level
/root/include/YSI/y_scripting.inc(622) : warning 219: local variable "addr" shadows a variable at a preceding level
/root/include/a_http.inc(22) : error 021: symbol already defined: "HTTP"
/root/include/YSI/internal/y_version.inc(122) : error 021: symbol already defined: "YVers_OnScriptInit"
/root/include/YSI/internal/y_version.inc(194) : error 021: symbol already defined: "YVers_Callback"
/root/include/a_http.inc(22) : error 021: symbol already defined: "HTTP"
/root/include/YSI/internal/y_version.inc(122) : error 021: symbol already defined: "YVers_OnScriptInit"
/root/include/YSI/internal/y_version.inc(194) : error 021: symbol already defined: "YVers_Callback"
/root/include/YSI/y_als.inc(59) : error 017: undefined symbol "inc_y_als"
/root/include/YSI/y_als.inc(59) : error 010: invalid function or declaration
/root/include/a_http.inc(22) : error 021: symbol already defined: "HTTP"
/root/include/YSI/internal/y_version.inc(122) : error 021: symbol already defined: "YVers_OnScriptInit"
/root/include/YSI/internal/y_version.inc(194) : error 021: symbol already defined: "YVers_Callback"
/root/include/a_http.inc(22) : error 021: symbol already defined: "HTTP"
/root/include/YSI/internal/y_version.inc(122) : error 021: symbol already defined: "YVers_OnScriptInit"
/root/include/YSI/internal/y_version.inc(194) : error 021: symbol already defined: "YVers_Callback"
/root/include/YSI/internal/y_shortfunc.inc(96) : error 021: symbol already defined: "U@"
/root/include/YSI/internal/y_shortfunc.inc(97) : error 021: symbol already defined: "V@"
/root/include/YSI/internal/y_shortfunc.inc(100) : error 021: symbol already defined: "W@"
/root/include/YSI/internal/y_shortfunc.inc(101) : error 021: symbol already defined: "P@"
/root/include/YSI/internal/y_shortfunc.inc(102) : error 021: symbol already defined: "O@"
/root/include/a_http.inc(22) : error 021: symbol already defined: "HTTP"
/root/include/YSI/internal/y_version.inc(122) : error 021: symbol already defined: "YVers_OnScriptInit"
/root/include/YSI/internal/y_version.inc(194) : error 021: symbol already defined: "YVers_Callback"
/root/include/YSI/internal/y_funcinc.inc(60) : error 021: symbol already defined: "@y_funcinc@_"
/root/include/YSI/y_hooks.inc(432) : error 021: symbol already defined: "YVers_OnScriptInit"
Compilation aborted.
26 Errors.
on windows it is compiling properly maybe a bug with undefining?
Is it possible to add the git commit hash or date to the version string?
Instead of "3664.samp" it would be something like "3664.samp.4d2c600507".
PLEASE disable this - give an error or something (not "tabsize", that has uses, just "0").
What whould be, if you would merge LSE version to the master? This version goal is fix bugs, so there will be another bug fixed, and if someone use this complier, then now would need to use crashdetect LSE .
I tried to use the latest release for Linux on my server (Debian 7.4 x64).
But if I try to execute the pawn compiler I get the following error:
./pawncc: error while loading shared libraries: libpawnc.so: cannot open shared object file: No such file or directory
When using pawndisasm on my -d3 33k lines compiled gamemode the disassembler crashes immediately. It works fine for -d0 though.
Also the instructions in the readme.txt don't accurately describe how to build from git - there are two sources directories (amx
, compiler
) which need separate cmake build directories
Various compiler errors. including:
pawn/source/amx/amx.c:493:5: error: enumerator value for ‘assert_static__’ is not an integer constant
Okay, firstly. I've been using the latest version and it's been perfect but lately I added a new function and it just won't allow me to use this function ANYWHERE. It's like if it has a function limit.
I removed all contents of the function and it's basically a return 1;
sendPlayerVerificationCode(playerid)
{
return 1;
}
then calling sendPlayerVerificationCode(playerid) anywhere crashes the script. Causing an 'access violation' error.
I HONESTLY can NOT recreate this outside my script.
I switched and to an old dropback version I use that only has line patches and 1 or 2 other things (11/03/2013 binary). The compiler then notified me about this error
"logoffDateStr = (logoffTime == 0) ? "(Player / Server) Crash / Exit" : realdate(logoffTime);"
which should actually be an error but the newer compiler was ignoring that fact that it was an error.
FIX -> (Wrapping the quotes with brackets) logoffDateStr = (logoffTime == 0) ? ("(Player / Server) Crash / Exit") : realdate(logoffTime);
I believe not using brackets around the quotes was a fix done in your updated pawn compiler right?
I honestly don't know what else to say about this, but this was my experience today.
This:
#define A%0\10;%1 B
#define B%0B C
A
When compiled with "-l" produces "C". My understanding of the pre-processor is that it should produce just "B"...
Introduce some sort of "compatibility mode" so that people could use the new features and bug fixes but still be able to compile their old code unchanged (perhaps via a new command-line switch).
Assume a matryoshka of kinds:
- test.pwn
- level_1
-- test.inc
-- level_2
--- test.inc
--- level_3
---- test.inc
When using backslash to specify path to included file, everything is nice. However, only that setup will work:
test.pwn
#include "level_1/test"
level_1/test.inc
#include "level_1\level_2/test"
level_2/test.inc
#include "level_1\level_2\level_3/test"
Is this intended behaviour?
This should not compile:
#include <a_samp>
GetString() {
new s[1] = {'0'};
return s;
}
main() {
new x = 0;
new s[2];
s = x ? "1" : GetString(); // "Invalid memory access" at runtime
printf("%s", s);
}
The compiler should check if the sizes of the two arrays match like it does here:
GetString() {
new s[] = "hello";
return s;
}
main() {
new s[1];
s = GetString(); // error 047: array sizes do not match, or destination array is too small
}
"BUG fix: the optimizer created incorrect code for subtraction a variable from a
constant."
Link: https://code.google.com/p/pawnscript/source/detail?spec=svn38&r=38#
If you have an include file that defines a static function f
and a script that includes that file and which also defines f
(but not static this time), the compiler will call the wrong function.
// bug.inc
static f() {
print("test");
}
// bug.pwn
#include <a_samp>
#include "bug"
f() {
print("f");
}
main() {
print("main");
f();
}
In the script above main
will recursively call itself instead of f
, which will everntually result in a stack overflow.
I'm not certain how compiler handles enumerators, but sizeof doesn't bode well with hidden array sizes:
enum E_TEST {
RandomValue,
StringValue[64]
};
new Anything[MAX_PLAYERS][E_TEST];
//...
sizeof Anything[0][StringValue]; //1 - it makes sense for compiler, but not for average user
Can't you add a pragma to hide a specific warning at compilation ?
For exemple, #pragma warning 203 will hide each warning 203 from the compile log.
Hello,
I've tried compiling my gamemode using linux compiler
mike@Mike-G550 /GM_LINUX/new_lin $ ls -all
total 160 drwxr-xr-x 3 mike mike 4096 Jan 29 17:16 . drwxr-xr-x 6 mike mike 4096 Jan 29 16:36 .. -rwxr-xr-x 1 mike mike 175 Jan 29 16:38 compile.sh drwxr-xr-x 3 mike mike 4096 Dec 9 2012 include -rw-r--r-- 1 mike mike 143910 Dec 9 2012 DB.pwn
with the following args (shell script):
mike@Mike-G550 /GM_LINUX/new_lin $ cat compile.sh
#!/bin/bash FISIER=$1 /GM_LINUX/pawno-c/pawncc $FISIER -i./include "-;" "-(" "-O1"
And, compiling fails with the following errors:
mike@Mike-G550/GM_LINUX/new_lin $ ./compile.sh newegDB.pwn
Pawn compiler 3.2.3664.samp Copyright (c) 1997-2006, ITB CompuPhase ./include/GM_functii/GM_comune.inc(1688) : error 029: invalid expression, assumed zero ./include/GM_functii/GM_comune.inc(1688) : error 008: must be a constant expression; assumed zero ./include/GM_functii/GM_xan_Bizuri.inc(1447) : error 029: invalid expression, assumed zero ./include/GM_functii/GM_xan_Bizuri.inc(1447) : error 008: must be a constant expression; assumed zero ./include/GM_functii/GM_xan_Arme.inc(79) : error 029: invalid expression, assumed zero ./include/GM_functii/GM_xan_Arme.inc(79) : error 008: must be a constant expression; assumed zero
./include/GM_functii/GM_comune.inc(1688)
AntiDeAMX() { new a[][] = { "Unarmed (Fist)", "Brass K", }; //-- line 1688 #pragma unused a }
./include/GM_functii/GM_xan_Bizuri.inc(1447)
stock NumeProdus(idprod) { static const sc_numeprod[][MAX_PROD_NAME] = { "\1", "Cell Phone", ..... // more lines here bla bla // more lines here }; //-- line 1447 if (0 <= idprod <= MAX_PRODUSE) { return sc_numeprod[idprod]; } return sc_numeprod[0]; } ./include/GM_functii/GM_xan_Arme.inc(79)new GunNames[51][MAX_GUN_NAME] = { "Nothing", "BrassKnuckles", "GolfClub", "Nitestick", "Knife", "BaseballBat", .. ... ... "Drugs", }; //-- line 79Any suggestions how to make it compile on linux?
Standard windows compiler from samp package.. is fine with the same parameters.Thank you in advance,
Mike.
I tried to replace the default Pawn compiler with this modified version.
The problem: Once I include md-sort or formatnumber by Slice the compiler crashes.
I've tested it with the current testing binaries from 02/02/2014 and the source of my server.
Would it be possible to increase maximum array depth to 4<? Compiler flag would suffice. Example usage
#define MAX_QUESTIONS 128
#define MAX_ANSWERS 4
enum E_TYPE {
TYPE_ONE,
TYPE_TWO
}
static const
QuestionAnswers[E_TYPE][MAX_QUESTIONS][MAX_ANSWERS][64]
;
It would be good if this was supported:
new arr[10][20] = {{0, 1, ...}, ...};
Even better:
new arr[10][20] = {{0, 1, 2, ...}, {0, 2, 4, ...}, ...};
Supporting the same increment rules across both dimensions.
See the discussion here: d9cc5e3#commitcomment-4992955
In new version pawncc 2015/04/07, functions with asm-format cause the server crash if i use more than one formatting param.
Example script:
#include "compiler/includes/a_samp"
#define BYTES_PER_CELL 4
stock example_log(fstring[], {Float, _}:...)
{
static const STATIC_ARGS = 1;
new n = (numargs() - STATIC_ARGS) * BYTES_PER_CELL;
if (n)
{
new message[144], arg_start, arg_end;
#emit CONST.alt fstring
#emit LCTRL 5
#emit ADD
#emit STOR.S.pri arg_start
#emit LOAD.S.alt n
#emit ADD
#emit STOR.S.pri arg_end
do
{
#emit LOAD.I
#emit PUSH.pri
arg_end -= BYTES_PER_CELL;
#emit LOAD.S.pri arg_end
}
while(arg_end > arg_start);
#emit PUSH.S fstring
#emit PUSH.C 144
#emit PUSH.ADR message
n += BYTES_PER_CELL * 3;
#emit PUSH.S n
#emit SYSREQ.C format
n += BYTES_PER_CELL;
#emit LCTRL 4
#emit LOAD.S.alt n
#emit ADD
#emit SCTRL 4
printf(message);
}
else
{
printf(fstring);
}
return 1;
}
public OnGameModeInit()
{
example_log("%d %d", 2, 2);
return 1;
}
I got this crashdetect log:
[18:36:39] [debug] Server crashed while executing default.amx
[18:36:39] [debug] AMX backtrace:
[18:36:39] [debug] #0 native format () [00471d20] from samp-server.exe
[18:36:39] [debug] #1 000001a4 in example_log (fstring[]=@0x00000004 "%d %d", ... <2 arguments>) at sources\default.pwn:37
[18:36:39] [debug] #2 000002b8 in public OnGameModeInit () at sources\default.pwn:54
[18:36:39] [debug] Native backtrace:
[18:36:39] [debug] #0 0046ce66 in ?? () from samp-server.exe
sources\default.pwn:37 is here:
n += BYTES_PER_CELL;
So I started porting YSI to run on this new compiler version, but I'm afraid it keeps crashing. So far, for no apparent reason, it crashes on:
https://github.com/Y-Less/YSI-Includes/blob/YSI.tl/YSI_Core/y_debug.inc#L283
https://github.com/Y-Less/YSI-Includes/blob/YSI.tl/YSI_Core/y_testing.inc#L192
https://github.com/Y-Less/YSI-Includes/blob/YSI.tl/YSI_Core/y_utils.inc#L845
I would comment out or not include one and find the next crash, 3 is all I bothered to do. The first one shouldn't be the same issue as before of natives not being included, because I know that one is - y_funcinc ensures that (and it works on the old compiler). This is with -d3 and can be reproduced with only:
#include <a_samp>
#include <YSI_Coding\y_hooks>
Hello,
I'm here reporting some problem which I ran into when I tried compiling my gamemode with linux compiler.
if (!strcmp(params, "primary"))
Doesn't work, it always, returns 0, whatever 'params' is.
if ( !strcmp(params, "primary", false, 6) )
It is working.
Now, my entire gamemode is broken, unless I rewrite each and every part where I use strcmp into 4 parameters variant.
Using latest SA:MP server 0.3z. Proof of concept GM, reproducing the issue:
#include <a_samp>
#include <zcmd>
new bool:gPlayerSpawned[MAX_PLAYERS char];
main()
{
print(" test strcmp ");
return 1;
}
public OnGameModeInit()
{
SetGameModeText("test strcmp");
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetSpawnInfo( playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );
return 1;
}
public OnPlayerSpawn(playerid)
{
SendClientMessage(playerid, -1, "Commands: /debug1 /debug2");
gPlayerSpawned{playerid} = true;
return 1;
}
COMMAND:debug1(playerid,params[])
{
if(gPlayerSpawned{playerid})
{
if (isnull(params)) {
SendClientMessage(playerid, -1, "|__________________ Spawn __________________|");
SendClientMessage(playerid, -1, "USAGE: /debug [primary / secondary]");
SendClientMessage(playerid, -1, "|___________________________________________|");
}
else
{
printf(params);
if (!strcmp(params, "primary"))
{
print("1");
SendClientMessage(playerid, -1, "primar.");
GameTextForPlayer(playerid, "~r~Primary", 1500, 1);
}
else if (!strcmp(params, "secondary"))
{
print("2");
SendClientMessage(playerid, -1, "secundar.");
GameTextForPlayer(playerid, "~r~Secondary", 1500, 1);
}
else SendClientMessage(playerid, -1, "Choose between primary and secondary !");
}
} else SendClientMessage(playerid, -1, "You can't use this action right now. Try again later!");
return 1;
}
COMMAND:debug2(playerid,params[])
{
if(gPlayerSpawned{playerid})
{
if (isnull(params)) {
SendClientMessage(playerid, -1, "|__________________ Spawn __________________|");
SendClientMessage(playerid, -1, "USAGE: /debug [primary / secondary]");
SendClientMessage(playerid, -1, "|___________________________________________|");
}
else
{
printf(params);
if ( !strcmp(params, "primary", false, 6) )
{
print("1");
SendClientMessage(playerid, -1, "primar.");
GameTextForPlayer(playerid, "~r~Primary", 1500, 1);
}
else if ( !strcmp(params, "secondary", false, 9) )
{
print("2");
SendClientMessage(playerid, -1, "secundar.");
GameTextForPlayer(playerid, "~r~Secondary", 1500, 1);
}
else SendClientMessage(playerid, -1, "Choose between primary and secondary !");
}
} else SendClientMessage(playerid, -1, "You can't use this action right now. Try again later!");
return 1;
}
Any suggestions?
Thank you in advance,
Mike.
Try this snippet in standard compiler, and with this compiler in compability mode:
#include <a_samp>
new foo[3][2][] = {
{"Bar","Bar"},
{"Boo","Boo"},
{"Bee","Bee"}
};
main() {
printf("%d, %s", sizeof foo, foo[0][0]);
}
Expected result: All is well
Actual result: error 052, multidimensional-arrays must be fully initialized
No idea why, maybe new ellipsis support changed that.
edit: Compability mode doesn't matter, it still reports this error
I have 272 declarations in one enum, when I add a new one. The compiler crashes.
Just going to modularise for now.
Hi,
I have a 100k+ lines gamemode, but after i hit compile, the compiler crash after ~1 second.
I just now changed from an older version of your Compiler with the line-limit patch, the current version of the compiler is the default (without line-limit patch)
Unhandled exception at 0x5C8C3F18 (pawnc.dll) in pawncc.exe: 0xC0000005: Access violation reading location 0x00000036.
What cause this?
EDIT:
I think i found the bug, Slice's formatnumber include cause the compiler crash.
http://forum.sa-mp.com/showthread.php?t=184328
To reproduce:
#include <formatnumber>
main()
{
}
Can you fix this bug?
Thank you
Could you alter "__Pawn" (#define VERSION_INT 0x0302) to something else so that we can detect in code when this version of the compiler is used please? I know 0x0303 and 0x0303 are taken by official compilers - maybe something outside their branch numbering like 0x030A (which would in their BCD system would be 0x0310 and so an impossible value otherwise).
^^
Using the latest version, every time I run the server with profiler plugin it shows Invalid/unsupported P-code file format
[11:22:55] [profiler] Error loading debug info: Invalid/unsupported P-code file format
[11:22:55] [profiler] Attached profiler to 'gamemodes/bcnr.amx' (no debug info)
E:\YSI 4.0\pawno\include\YSI..\YSI_Core\y_master.inc(133) : fatal error 111: user error: Did you do < YSI-Core/y_master > instead of the required < YSI-Core\y_master >?
With the 2 posted binaries (on github) I end up receiving this error however with the older version posted on the samp forums the compiler works fine.
I'm using the latest binaries provided on the release page. (pawncc 2014/08/31)
Declaring variable:
http://pastebin.com/H0kXEYdv
I use it as parameter in this function call (http://pastebin.com/6SrNFa73) and in combination with 'sizeof' keyword.
//Later edit: I don't know if it is indeed a problem or it is my fault ( as I'm using it in combination with a tweak that allows me to create 4 dimensional arrays ). However, I found a work-around: moving entire code from include file to gamemode ( I had that variable and some other codes declared in a include file and used in gamemode. After I moved that content to gamemode header, it compiled perfectly. )
i tried compiling my script 👍 but i needed to edit a lot of files from YSI because of the slash problems im planning to make an online IDE for my friend but it will cause problems (the slashes)
For some reason, even if I move pawncc
and libpawnc.so
to /usr/bin
and /usr/lib
, it includes include/default.inc
.
It started failing because print and printf were already defined, and it took a while until I found where they came from.
Are the default include files really needed?
When using #include <somefile>
and there's a directory with the same name the compiler will try to read the directory first and only when that fails will it append the .inc extension. This doesn't work great on Linux where fopen won't fail and return NULL even if the filename points to a directory.
For example, this is what happens when you #include <YSI_Coding/y_inline>
from YSI 4.0:
open("/samp/include/YSI/YSI_Coding/y_inline", O_RDONLY) = 5
fstat64(5, {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xfffffffff76d5000
_llseek(5, 0, [0], SEEK_CUR) = 0
read(5, 0xf76d5000, 4096) = -1 EISDIR (Is a directory)
_llseek(5, 0, [0], SEEK_SET) = 0
read(5, 0xf76d5000, 4096) = -1 EISDIR (Is a directory)
read(5, 0xf76d5000, 4096) = -1 EISDIR (Is a directory)
read(5, 0xf76d5000, 4096) = -1 EISDIR (Is a directory)
read(5, 0xf76d5000, 4096) = -1 EISDIR (Is a directory)
read(5, 0xf76d5000, 4096) = -1 EISDIR (Is a directory)
read(5, 0xf76d5000, 4096) = -1 EISDIR (Is a directory)
read(5, 0xf76d5000, 4096) = -1 EISDIR (Is a directory)
read(5, 0xf76d5000, 4096) = -1 EISDIR (Is a directory)
read(5, 0xf76d5000, 4096) = -1 EISDIR (Is a directory)
read(5, 0xf76d5000, 4096) = -1 EISDIR (Is a directory)
read(5, 0xf76d5000, 4096) = -1 EISDIR (Is a directory)
read(5, 0xf76d5000, 4096) = -1 EISDIR (Is a directory)
read(5, 0xf76d5000, 4096) = -1 EISDIR (Is a directory)
read(5, 0xf76d5000, 4096) = -1 EISDIR (Is a directory)
read(5, 0xf76d5000, 4096) = -1 EISDIR (Is a directory)
read(5, 0xf76d5000, 4096) = -1 EISDIR (Is a directory)
read(5, 0xf76d5000, 4096) = -1 EISDIR (Is a directory)
read(5, 0xf76d5000, 4096) = -1 EISDIR (Is a directory)
read(5, 0xf76d5000, 4096) = -1 EISDIR (Is a directory)
...
The bugs is explained in the pastebin
http://pastebin.com/swe1twvy
Using the version released at: 06/04/2014
I'm on Windows 8.1, x64
Windows Update broke my pawn compiler so I am switching everything to my Linux computer until I fixed that.
Now after compiling the pawn compiler and typing the command:
./pawncc main.pwn "-\(+ -;+ -O1 -d0"
It throws me fatal error 100: cannot read from file: "internal\y_natives".
Since all includes use ** rather than / I wonder if there is an easy solution to get Linux to support backslashes. Replacing them in every file is not really an option.
It's not an issue and I'm quite new on GitHub, but anyway, since include guards have been removed, what about implementing #pragma once directive? (http://en.wikipedia.org/wiki/Pragma_once)
In 0c8f234 you fixed strings in ternary operators, which breaks the following line of code (created by macros):
new Response__;static const Response[]=# Response":..."#@Ia#@Ib#@Ib#@Ib#@Ib#@Ib#@Ic#:iiiis;for(new pid, dialogid, response, listitem,text0[(130)];Inline_Loop(.y= Response__,.f= Response);)
Compiling with the old compiler works, while the new one generates an error.
The problem that may concern some compilers is that "sEXPRSTART" is defined as 0x80 and buffers "stgbuf", "stgpipe", function "stgmark" and other releated functions which deal with them are defined as "char" which if the compiler defines it to be "signed" means that the maximum is SCHAR_MAX which is 2^7-1 or 127 or 0x7F clearly causing overflow, if the compiler defines the "char" as "unsigned" then there won't be any problems because the maximum is UCHAR_MAX which is 2^8-1 or 255 or 0xFF. Note that "sEXPRSTART" directly relates to the "sMAXARGS" defined as 127(0x7F) which is maximum amount of arguments. Probably the best solution is to define everything that concerns those buffers as "unsigned char" and cast it to appropriate "char" where needed(e.g. strlen).
Can you see any reason why this line would suddenly break compilations? It seems that after I do that it can no longer find include files - is this a special symbol I didn't know about?
Hello,
i'm not sure if is an problem from YSI or the compiler however only is happening with new version of compiler.
I get this errors:
[09/04/2015 00:15:44] ���*** YSI Error: Could not determine pattern type in y_inline
[09/04/2015 00:12:51] ���*** YSI Error: Format specifier didn't match on inline function Login:..�@ia@Ib@Ib@Ib@Ib@Ib@Ic:iiiis
y_inline: https://github.com/Y-Less/YSI-Includes/blob/master/y_inline.inc
well with the version of pawncc 2014/11/16 & pawndisasm 2014/11/16 this works well without any problem, any idea what can be?
Well crashdetect dont say anything...
-i option on Windows works fine, but on Linux this ignored.
I have this file struct:
.
├── !compile.sh
├── !compile.bat
├── compiler
│ ├── includes
│ │ ├── a_http.inc
│ │ ├── a_npc.inc
│ │ ├── a_objects.inc
│ │ ├── a_players.inc
│ │ ├── a_sampdb.inc
│ │ ├── a_samp.inc
│ │ ├── a_vehicles.inc
│ │ ├── core.inc
│ │ ├── datagram.inc
│ │ ├── file.inc
│ │ ├── float.inc
│ │ ├── string.inc
│ │ └── time.inc
│ ├── libpawnc.so
│ ├── pawncc
│ ├── pawncc.exe
│ ├── pawncc.pdb
│ ├── pawnc.dll
│ └── pawnc.pdb
├── gamemodes
├── plugins
├── scriptfiles
└── sources
└── Open-GTO.pwn
!compile.sh:
#/bin/bash
export LD_LIBRARY_PATH=$(pwd)"/compiler/:$LD_LIBRARY_PATH"
NAME="Open-GTO"
./compiler/pawncc "-;+ -(+ -icompiler/includes" sources/$NAME.pwn
if [ $(stat -c%s "$NAME.amx") -gt 0 ];
then
mv $NAME.amx gamemodes/
else
rm $NAME.amx
fi
!compile.bat:
set name=Open-GTO
compiler\pawncc.exe -;+ -(+ -icompiler/includes sources\%name%.pwn
if exist %name%.amx ^
move %name%.amx gamemodes\
pause
On Linux i get this error:
compiler/includes/a_samp.inc(17) : fatal error 100: cannot read from file: "core"
On Windows all works fine.
Currently i made this "hack":
I changed it in a_samp.inc:
#include <core>
#include <float>
#include <string>
#include <file>
#include <time>
#include <datagram>
#include <a_players>
#include <a_vehicles>
#include <a_objects>
#include <a_sampdb>
on it:
#include "compiler/includes/core"
#include "compiler/includes/float"
#include "compiler/includes/string"
#include "compiler/includes/file"
#include "compiler/includes/time"
#include "compiler/includes/datagram"
#include "compiler/includes/a_players"
#include "compiler/includes/a_vehicles"
#include "compiler/includes/a_objects"
#include "compiler/includes/a_sampdb"
#include "compiler/includes/a_http"
Briefly,
case 4: { showPoliceRefill(playerid, .refillType = 1); return 1; }
works
but
case 4: showPoliceRefill(playerid, .refillType = 1);
crashes the compiler (it reports 26 errors with the latest test binary)
showPoliceRefill(playerid); works fine but showPoliceRefill(playerid, .refillType = 1); doesn't
It crashes with a default function argument
main()
{
new playerid, option = 1;
switch(option)
{
case 1: showPoliceRefill(playerid, .refillType = 1);
}
}
showPoliceRefill(playerid, refillType = 0)
{
switch(refillType)
{
case 0: functionex();
case 1: functionex();
}
}
functionex()
{
return 1;
}
EDIT: I can't get it recreated in a blank script, it happens in my large script. -.-
When I try to compile with this, the compiler outputs an error:
new floornames2[2][10] =
{
"abcde",
"defgh"
};
print(floornames2[0]);
No matter the array is global or not, it just gives an error at the line of the last element:
error 037: invalid string (possibly non-terminated string)
It can be easily fixed by putting the braces and colon right after the last element, but it isn't a very good practice to put that there I think.
In the "#warning" section of the "What's new" page:
https://github.com/Zeex/pawn/wiki/What's-new#warning
The example uses "#pragma warning" instead of "#warning".
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.