Re: PureBasic 6.00 Alpha 1 released !
Posted: Wed May 19, 2021 11:38 am
In this alpha version is the /PREPROCESS command not supported?
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
---------------------------
PureBasic
---------------------------
The compiler isn't loaded yet... please try again.
---------------------------
OK
---------------------------
Does this render DataSection useless? (how to access data objects in the DataSection without a label?)Fred wrote: Wed May 19, 2021 10:08 am C Backend limitations:
- No Label address in datasection (?Label)
Code: Select all
Data.i ?Label
+1
Code: Select all
purebasic.c:3783:1: warning: implicit declaration of function 'SYS_FastAllocateStringFree4'; did you mean 'SYS_FastAllocateString4'? [-Wimplicit-function-declaration]
Code: Select all
purebasic.c:21893:2: error: unknown type name 'PUSH'
PUSH esp
^~~~
purebasic.c:21894:2: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'PUSH'
PUSH dword PM_386
^~~~
...
^~~~~~~~~~~~~~~~~~~~~~~~
Code: Select all
!__attribute__((optimize("-Ofast")))
Procedure t()
EndProcedure
t()
Code: Select all
// Procedure t()
static integer f_t() {
integer r=0;
// EndProcedure
end:
return r;
}
//
...
...
...
...
//
void ___chkstk_ms(integer a) { return; }
int __stdcall WinMain(void *instance, void *prevInstance, void *cmdLine, int cmdShow) {
PB_Instance = GetModuleHandleW(0);
PB_MemoryBase = HeapCreate(0,4096,0);
// !__attribute__((optimize("-Ofast")))
__attribute__((optimize("-Ofast")))
// t()
integer rr0=f_t();
SYS_Quit();
}
I misinterpreted it the same way... but it's actually perfectly described in the text.
Well I'm still confused about it - how to access data in DataSection when there's no ?label ?oreopa wrote: Thu May 20, 2021 12:44 am I misinterpreted it the same way... but it's actually perfectly described in the text.
Code: Select all
DataSection
VTable:
Data.i ?Procedures ; <- This thing here
Procedures:
Data.i @Ceci(), @Cela()
EndDataSection
Ahh ok thankyou for clarifying, that makes sense. I think I've only used ?Label within a DataSection once anyway (for a jump table, which isn't important), so it seems 99% of my source code that uses DataSection should still work fine - cool! sorry to Fred for my misunderstandingSTARGÅTE wrote: Thu May 20, 2021 12:59 am You can still use ?Label to get the address of a label: in a data section.
But you can not use (at the moment) such syntax "?Label" in a data section itself.