Get access to C-backend compiler switches?

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Skipper
User
User
Posts: 62
Joined: Thu Dec 19, 2024 1:26 pm
Location: Europe

Get access to C-backend compiler switches?

Post by Skipper »

Can we please have access to the C-backend's compiler switches without having to resort to external scripts ?
Thanks!

Cheers,
Skipper
<< Win-11 (x64: XEON + i5) / Mint linux (x64: i3) / MacOS Monterey (Intel x64) >>
User avatar
idle
Always Here
Always Here
Posts: 6088
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Get access to C-backend compiler switches?

Post by idle »

would be handy, you could also use pragma to some extent, like if you want to optimize a function or ignore a warning

you can test if it works like this
!#pragma optimize ("-O3");
procedure foo()

or to unroll a loop
!#pragma ivdep;
While(r > #size)
Quin
Addict
Addict
Posts: 1155
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: Get access to C-backend compiler switches?

Post by Quin »

+100
User avatar
Skipper
User
User
Posts: 62
Joined: Thu Dec 19, 2024 1:26 pm
Location: Europe

Re: Get access to C-backend compiler switches?

Post by Skipper »

idle wrote: Thu Sep 04, 2025 11:42 pm would be handy, you could also use pragma to some extent, like if you want to optimize a function or ignore a warning

you can test if it works like this
!#pragma optimize ("-O3");
procedure foo()

or to unroll a loop
!#pragma ivdep;
While(r > #size)
Thanks for pointing this out. Would it work globally, for the entire application too? Going to test later today....

cheers
Skipper
<< Win-11 (x64: XEON + i5) / Mint linux (x64: i3) / MacOS Monterey (Intel x64) >>
User avatar
idle
Always Here
Always Here
Posts: 6088
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Get access to C-backend compiler switches?

Post by idle »

I don't think it does it globally. you just do it before a function as far as I recall.
Post Reply