Pelles C forum

Pelles C => General discussions => Topic started by: Akko on November 17, 2021, 04:44:27 PM

Title: __POCC__OLDNAMES
Post by: Akko on November 17, 2021, 04:44:27 PM
I am using latest version 11.00.2. My program does not compile with POCC although it does compile with gcc, vcc, clang, tcc.
Reason: the program section for file I/O uses Posix functions like open, read, close.
However POCC prepends them with an _underscore like _open, _read, _close (declared in <io.h>)
IIUC when the preprocessor symbol __POCC__OLDNAMES is defined, they are recognized in Posix syntax as well.
But I just can't get it to work.

CC-flags: -Tx64-coff -std:C99 -Ob1 -fp:precise -W1 -Gd -Ze -Zx -J
LINK-flags: -machine:x64 -subsystem:console kernel32.lib advapi32.lib delayimp64.lib

If this is no bug but just my incompetence, please feel free to move my posting to where it belongs
Title: Re: __POCC__OLDNAMES
Post by: TimoVJL on November 17, 2021, 05:41:01 PM
Use pocc -Go
Quote
Description:
The /Go option makes the compiler accept alternate names for some C runtime functions. It will also define the symbol __POCC__OLDNAMES in the compiler.

Title: Re: __POCC__OLDNAMES
Post by: Akko on November 17, 2021, 06:13:37 PM
Thanks a lot, that did it!

Accidently I looked up CC options, but not POCC options which are many more, and not all are accessible by the IDE project options dialog box.
Title: Re: __POCC__OLDNAMES
Post by: frankie on November 17, 2021, 06:15:49 PM
As general rule of thumbs you should never set compiler internal symbols (those prepended by one or more underscores), because they are automatically set by the compiler when appropriate configuration is selected using compiler switches.
This because the symbols definition could be only a part of internal compiler configuration.