Code Monkey home page Code Monkey logo

Comments (14)

Y-Less avatar Y-Less commented on August 29, 2024

"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.

vulturm avatar vulturm commented on August 29, 2024

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.

Zeex avatar Zeex commented on August 29, 2024

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.

vulturm avatar vulturm commented on August 29, 2024

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.

Zeex avatar Zeex commented on August 29, 2024

4de719ab2a
sa-mp-001

from compiler.

Zeex avatar Zeex commented on August 29, 2024

Are you sure you didn't have extra spaces after "primary", like "primary "?

from compiler.

vulturm avatar vulturm commented on August 29, 2024

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.

Zeex avatar Zeex commented on August 29, 2024

https://github.com/Zeex/pawn/releases/tag/binaries-20140202
Did you use this one?

from compiler.

vulturm avatar vulturm commented on August 29, 2024

Well, no. I compiled it locally, from git master (latest source).

from compiler.

Zeex avatar Zeex commented on August 29, 2024

OK, then try that one please.

from compiler.

vulturm avatar vulturm commented on August 29, 2024

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.

Zeex avatar Zeex commented on August 29, 2024

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.

vulturm avatar vulturm commented on August 29, 2024

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.

vulturm avatar vulturm commented on August 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.