Search found 2403 matches

by coderJeff
Feb 01, 2021 5:32
Forum: Documentation
Topic: Basic-Macros in fbc 1.08
Replies: 59
Views: 4295

Re: Basic-Macros in fbc 1.08

Was bit of long walk, but I got there. Should be fixed in fbc/master now. And bitcontainer with -d REAL_CODE and -d REAL_HEADERS will compile now. I added an error message for __FB_EVAL__ if does actually have a bad expression that's hopefully not too wonky. Previously, there could be junk after a v...
by coderJeff
Feb 01, 2021 2:54
Forum: Documentation
Topic: Basic-Macros in fbc 1.08
Replies: 59
Views: 4295

Re: Basic-Macros in fbc 1.08

It's going to be something dumb like a single extra or missed bracket but I've been looking for it all day and still have no idea what or where It's not your code... A bug (or bugs), somewhere in the compiler __FB_UNQUOTE__( __FB_EVAL__( "#define " "X" " 1" ) ) print X...
by coderJeff
Jan 31, 2021 19:49
Forum: Documentation
Topic: Executables and Compiling
Replies: 16
Views: 638

Re: Executables and Compiling

So far as discussed in this topic, the module constructors / destructors are a low level feature of the start-up framework which involves gcc & c runtime code that executes before and after our usercode. We don't have much control over it. Here we're going to build our own user code for construc...
by coderJeff
Jan 31, 2021 17:07
Forum: Beginners
Topic: Main line code in modules that are not the main module
Replies: 3
Views: 314

Re: Main line code in modules that are not the main module

For what it's worth, I tried to come up with a non-trivial example of something you might do with module level code in some other module. I think there are better ways to do this. Nonetheless, fbc allows this. This example initializes an array at start-up in the "primes.bas" module before ...
by coderJeff
Jan 31, 2021 16:47
Forum: Documentation
Topic: Executables and Compiling
Replies: 16
Views: 638

Re: Executables and Compiling

For these module constructors and module destructors , it really should be noted with a big WARNING on their use. Because this code is run outside of user code, it's quite likely that fbc's error checking and some runtime facilities won't work as expected. The result is that if an error occurs in th...
by coderJeff
Jan 31, 2021 16:10
Forum: Documentation
Topic: Basic-Macros in fbc 1.08
Replies: 59
Views: 4295

Re: Basic-Macros in fbc 1.08

I guessed you meant to have BitContainer.zip in the link. I was able to reproduce the error. First try through debugging of fbc was a bit of trial and error to see that it is related to lex.bi:LEX_MAXBUFFCHARS which is currently 8192. Changing the value of LEX_MAXBUFFCHARS to +1 will cause the compi...
by coderJeff
Jan 30, 2021 22:36
Forum: Documentation
Topic: Executables and Compiling
Replies: 16
Views: 638

Re: Executables and Compiling

Btw I miss module destructors and maybe also class constructors/destructors in the list. Maybe FB doesn't have them? (Class constructors are called for the class type as a kind of ctor if the class is actually used (not smartlinked out). A way of decentralizing ctor/dtor support in an per class/OOP...
by coderJeff
Jan 30, 2021 22:31
Forum: Documentation
Topic: Executables and Compiling
Replies: 16
Views: 638

Re: Executables and Compiling

I think this will get too complicated if we jump right in to the DLL stuff. If I remember correctly there's some differences between windows and linux. Is there a difference if: the other module is compiled at the same time as the main module, the other module is used as a static library, There's no...
by coderJeff
Jan 30, 2021 18:39
Forum: Documentation
Topic: Executables and Compiling
Replies: 16
Views: 638

Re: Executables and Compiling

Describe it as the first user code to be run by the startup framework or so. No details, concise, and still correct. That sounds workable. Yeah, "entry point" on it's own or even coupled with "user code entry point" could be still be confusing due the specific meaning for linker...
by coderJeff
Jan 30, 2021 17:41
Forum: Documentation
Topic: Executables and Compiling
Replies: 16
Views: 638

Re: Executables and Compiling

With Compiler Option -nodeflibs the actual start-up and initializing code will come in to play as we are no longer linking against the C runtime. Need to correct myself here: fbc still pulls in some the init/exit code with some crt?.o, crtbegin.o, crtend.o. I'd have to look through each platform / ...
by coderJeff
Jan 30, 2021 17:11
Forum: Documentation
Topic: Executables and Compiling
Replies: 16
Views: 638

Re: Executables and Compiling

I think the goal here should be a few concepts that can help build an understanding: - executable programs need a "main" point of entry - fbc may or may not create an implicit main function, depending on options or method of building an executable - some fbc options / methods of compiling ...
by coderJeff
Jan 30, 2021 14:56
Forum: Documentation
Topic: Executables and Compiling
Replies: 16
Views: 638

Re: Executables and Compiling

Compile process for an executable When fbc compiles basic source code, it translates the source in to another format that can be used by other tools that eventually create an executable. By default, fbc will use these other tools automatically. To see all the steps that fbc uses, specify '-v' on th...
by coderJeff
Jan 30, 2021 14:38
Forum: Documentation
Topic: Executables and Compiling
Replies: 16
Views: 638

Executables and Compiling

I had been thinking about this wiki page for a while: Executables When testing a bug , I got confused about some of fbc's command line options, and that helped lead me to what I might want to say to explain about executables. Compiling an Executable, in general fbc is a compiler that takes fbc sourc...
by coderJeff
Jan 27, 2021 22:09
Forum: General
Topic: Nested GOSUBs crashes the program if compiled with GCC 64-bit
Replies: 16
Views: 634

Re: Nested GOSUBs crashes the program if compiled with GCC 64-bit

Even if it means opening a new bug report to keep in mind the few points that you still think need to be clarified: https://www.freebasic.net/forum/viewtopic.php?p=279385#p279385 I don't think there's a bug there. I'm sure I used wrong options when testing. I believe I confused '-r' for '-R'. There...
by coderJeff
Jan 25, 2021 5:15
Forum: General
Topic: Nested GOSUBs crashes the program if compiled with GCC 64-bit
Replies: 16
Views: 634

Re: Nested GOSUBs crashes the program if compiled with GCC 64-bit

I found some things, and made one fix. Not sure if it's the right fix, but it's an improvement, I think. 1) yes, saw that _setjmp() on mingw-w64 for win64 needs 2 args, not 1. So there was likely stack corruption there causing a crash. I've never touched gosub/setjmp/longjmp since writing it, like 1...

Go to advanced search