Search found 375 matches

by TeeEmCee
Oct 14, 2023 0:36
Forum: General
Topic: Concerning the lack of inline functions
Replies: 14
Views: 2312

Re: Concerning the lack of inline functions

Out of curiosity, why? I can come up with many cases where using 32bit ints over native int size (64 probably) is preferable. But what's your reason? This is the OHRRPGCE game engine, BTW. Answering both why 32-bit and why redefine: The most important reason is so that in-memory and on-disk data fo...
by TeeEmCee
Oct 13, 2023 4:20
Forum: General
Topic: XML Editor?
Replies: 2
Views: 1478

Re: XML Editor?

Yeah, XML is a nasty file format, it's far more complicated than it looks and full-featured libraries are large. Whatever xml files you're dealing with probably don't use all those features though, so a small library could be used. Paul Doe has one for reading XML written in FB as part of fb-framewo...
by TeeEmCee
Oct 11, 2023 11:11
Forum: Projects
Topic: Gas64 (no more use of gcc, only gas) WDS / LNX
Replies: 494
Views: 107138

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Yes, I'm using Linux, I didn't think it would matter. I see there's an error number for internal errors... errReport( FB_ERRMSG_INTERNAL, , " global variable/array initializer nesting level too deep (MAXVARINISCOPES=" & MAXVARINISCOPES & ")" ) But FB_ERRMSG_INTERNAL just ...
by TeeEmCee
Oct 11, 2023 6:47
Forum: General
Topic: Concerning the lack of inline functions
Replies: 14
Views: 2312

Re: Concerning the lack of inline functions

So this is the output of -gen gcc I get with latest git, when I change the multiplication to \: int32 vr$4 = RANDINT( ); A$0 = vr$4; int32 vr$5 = RANDINT( ); B$0 = vr$5; C$0 = (int32)(int64)(A$0 / B$0); I failed to notice the casts are still there when doing a multiplication, as you showed. (Also, t...
by TeeEmCee
Oct 11, 2023 6:18
Forum: General
Topic: Concerning the lack of inline functions
Replies: 14
Views: 2312

Re: Concerning the lack of inline functions

(EDIT: argh, I forgot/overlooked the C code you posted.) Thanks for the testcase. But I think SARG was talking about what gas64 does (uses 64-bit registers most of the time), not about what FB does in general. Because I don't think it's true that FB uses 64-bit ints for intermediate calculation resu...
by TeeEmCee
Oct 11, 2023 5:54
Forum: Projects
Topic: Gas64 (no more use of gcc, only gas) WDS / LNX
Replies: 494
Views: 107138

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

(Shouldn't fbc throw an error if an internal error in gas64 like that happens?) I tried out gas64 (more comments and benchmarks here ) and am very pleased to see that it now works most of the time! (Turns out it was already working in fbc 1.10 for me, while fbc 1.09 produced a program that segfaulte...
by TeeEmCee
Oct 11, 2023 2:03
Forum: General
Topic: Concerning the lack of inline functions
Replies: 14
Views: 2312

Re: Concerning the lack of inline functions

FB does have inline functions (when using -gen gcc) . The keyword is PRIVATE (which is equivalent to 'static' in C). Marking a function PRIVATE indicates that the function is internal to that module and can't be called from outside it. But it also tells the compiler not to export that symbol (so fo...
by TeeEmCee
Oct 09, 2023 1:10
Forum: Linux
Topic: Program icon not showing at least in Cinnamon
Replies: 2
Views: 1364

Re: Program icon not showing at least in Cinnamon

I've never tried Cinnamon and haven't bothered with embedding an .xpm icon into Linux executables anyway so can't say. Sounds like a problem that might not be FB specific. A quick search found this comment, does that match your symptoms?
by TeeEmCee
Oct 08, 2023 1:32
Forum: Community Discussion
Topic: Bugs
Replies: 115
Views: 20839

Re: Bugs

It turns out that emitting -9223372036854775808ull is intentional. From hEmitInt in the C emitter: if( typeIsSigned( dtype ) ) then s = str( value ) '' Prevent GCC warnings for INT_MIN/LLONG_MIN: '' The '-' minus sign doesn't count as part of the number '' literal, and 2147483648 is too big for a 32...
by TeeEmCee
Sep 27, 2023 11:35
Forum: Community Discussion
Topic: FreeBASIC for Apple OS
Replies: 18
Views: 3269

Re: FreeBASIC for Apple OS

in MacOS Mojave when trying to build the latest Git repo I get unknown ld option --eh-frame-hdr at the stage of linking fbc, have no idea why Back in early 2022 the commit "Further flag required for ld on linux" mistakenly added --eh-frame-hdr to the ld commandline on all Unices. My best ...
by TeeEmCee
Sep 27, 2023 11:19
Forum: Community Discussion
Topic: Possible bug? Undefined behavior in C emitted code?
Replies: 13
Views: 2500

Re: Possible bug? Undefined behavior in C emitted code?

Looking at the issue you filed. I'm really surprised to see the bug seems to be in really far down in LLVM. Nice work narrowing down the original problem and reporting it. But still, should fbc be emitting C code which left-shifts negatives? We might hope to support other compilers aside from GCC an...
by TeeEmCee
Sep 27, 2023 2:05
Forum: Community Discussion
Topic: Possible bug? Undefined behavior in C emitted code?
Replies: 13
Views: 2500

Re: Possible bug? Undefined behavior in C emitted code?

Yes, this is a bug in fbc. Normally I would have expected that bitshifting a negative in this way would just cause a warning, if anything, that could be ignored, but C and C++ compilers do sometimes really punish you hard for technically undefined behaviour. It recently changed to be well defined, s...
by TeeEmCee
Nov 29, 2022 6:30
Forum: Community Discussion
Topic: FreeBASIC color on GitHub
Replies: 3
Views: 991

Re: FreeBASIC color on GitHub

I can't complain about the current colour, but it does make sense to make it distinct from VBA, from which was the Linguist definition was copied IIRC. I think a saturated colour such as that blue is easier to tell apart.
by TeeEmCee
Jul 28, 2022 4:08
Forum: Beginners
Topic: Does FreeBasic has a main() something like?
Replies: 9
Views: 1150

Re: Does FreeBasic has a main() something like?

Some of the above replies are confusing. If you name a sub/function 'main' in FB, the actual function name becomes 'MAIN' in the object file, so it's completely different to the automatic 'main' function generated by fbc. So 'main' is not a reserved keyword in FB. In each module, the top-level code ...
by TeeEmCee
Jul 28, 2022 3:53
Forum: General
Topic: What is the FreeBasic equivalent to "char" in C++?
Replies: 13
Views: 1685

Re: What is the FreeBasic equivalent to "char" in C++?

Specifically, FB attempts (incomplete) ABI compatibility with GNU g++. There is no support for other C++ compilers (though I don't know how compatible g++ and clang++ are) . Likewise, its GCC emitter outputs C code that contains GCC-isms and can only be compiled with difficulty using clang (despite ...