Comments (14)
"strcmp" works fine for me - it's a native function so the compiler used shouldn't have any effect on its operation. The only issue would be if default parameters were broken in this compiler, but I tested with just 2 and it still worked.
from compiler.
Hello,
Thank you for answering!
Ok, Have you tested with the GM above ? with linux compiler + latest samp includes then load it on 0.3z?
/home/_CODING/_EG/compiler/pawncc --version Pawn compiler 3.2.3664.samp Copyright (c) 1997-2006, ITB CompuPhase
I compiled it with the following parameters:
./pawncc natives.pwn -i./pawno-3/include "-;" "-(" "-O1" "-d3"
It's even running on my test server now: 188.241.116.230
No scriptfiles, no plugins. Just this GM.
from compiler.
If it's just one function you could simply call it in main() instead of making commands that require downloading extra includes and launching the game. Also your code worked fine for me with both Linux and Windows compilers, though I edited it a bit but that shouldn't matter.
By the way, -O1 is kind of pointless with -d3 as it turns all optimizations off:
-d<num> debugging level (default=-d3)
0 no symbolic information, no run-time checks
1 run-time checks, no symbolic information
2 full debug information and dynamic checking
===> 3 same as -d2, but implies -O0
from compiler.
Hi,
Thank you.
So, isnt't it something related to the 4'th parameter (length=cellmax) being set to '0' or something?
Have you tested the exact code inside a game ? Because, I also added some debug code in OnGameModeInit
if(strcmp("127.0.0.1","127.0.0.2",true) != 0) printf("false");
if(strcmp("127.0.0.1","127.0.0.1",true) == 0) printf("true");
And it does print
false
true
in server_log.txt
from compiler.
from compiler.
Are you sure you didn't have extra spaces after "primary", like "primary "?
from compiler.
Well, no I haven't :) This was just a general example. This scenario happens to every command that I use with strcmp. Also, my players first reported this issue.
In the example posted, commands behavior is:
/debug1 output is 'primary' no matter of the parameter
/debug2 output is working just fine (primary or secondary, depending of the parameter).
I'm at work right now, and I can't test it. But here is my example compiled if you want to try it: http://forum.egaming.ro/docs/natives.amx
from compiler.
https://github.com/Zeex/pawn/releases/tag/binaries-20140202
Did you use this one?
from compiler.
Well, no. I compiled it locally, from git master (latest source).
from compiler.
OK, then try that one please.
from compiler.
Have you tested my compiled example and there is a problem ?
What could possibly go wrong with my compiler?
ccmake CMakeList.txt , configure, generate, make
Ok, thank you for support! I'll test it as soon as I arrive home.
from compiler.
Did you build the compiler on a 64-bit system? There might be slight differences in the 64-bit version, although cell size is the same (32 bits).
from compiler.
Yes, all my machines are 64 bit. And I guess, the development tools are the same versions as the ones installed on my work laptop, since is running same version of linux mint:
gcc version 4.8.1 (Ubuntu/Linaro 4.8.1-10ubuntu9)
ccmake version 2.8.11.2
GNU Make 3.81
If you need any more info I could tell you when I get home.
from compiler.
Hello Zeex,
I'm very grateful that you pointed me into the right direction. Strcmp is working fine again, with the binary version from: https://github.com/Zeex/pawn/releases/tag/binaries-20140202
Seems like it doesn't like the 64 bit compiler.
Another wonderful thing happened, compile time is also lower:
With the old compiler:
Pawn compiler 3.2.3664.samp Copyright (c) 1997-2006, ITB CompuPhase
Header size: 24284 bytes
Code size: 2343256 bytes
Data size: 6359104 bytes
Stack/heap size: 16384 bytes; estimated max. usage=1262 cells (5048 bytes)
Total requirements: 8743028 bytes
real 0m11.744s
user 0m11.579s
sys 0m0.140s
with the new compiler:
Pawn compiler 3.2.3664.samp Copyright (c) 1997-2006, ITB CompuPhase
Header size: 24284 bytes
Code size: 2343260 bytes
Data size: 6359104 bytes
Stack/heap size: 16384 bytes; estimated max. usage=1262 cells (5048 bytes)
Total requirements: 8743032 bytes
real 0m8.612s
user 0m8.549s
sys 0m0.046s
Not that I'm making a big deal of it. 3 seconds, is not such a large margin, but still, it's also an improvement 👍
This issue can be closed, if you want to investigate what happens with x64 bit systems, then you can leave it open.
Thanks again!
from compiler.
Related Issues (20)
- Remove `-Z` HOT 1
- Stop Compiler
- Samp includes error HOT 1
- Packed string access in enum arrays
- Optimization of conditional expressions
- Can't compile on linux! HOT 2
- when to wait for the next build? HOT 1
- Classes and objects in PAWN? HOT 3
- Compiler giving false positive warnings (240) HOT 4
- Named only parameters. HOT 3
- External natives are always in the header, even when not used. HOT 2
- Constant "Run time error 19: "File or function is not found"" error
- default include path for standard libraries? HOT 1
- The Application was unable to start correctly.(0xc000007b) HOT 1
- fatal error 100: cannot read from file: "Pawn.CMD" HOT 1
- fatal error 100: cannot read from file: "interception"
- [DIY] Build from source on Apple Chip M1 using rosetta2 HOT 6
- `initialization data exceeds declared size` when using progressive initialization with an array size 1
- `const` can be specified for a function argument more than once
- error compile
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compiler.