opensmalltalk-vm icon indicating copy to clipboard operation
opensmalltalk-vm copied to clipboard

implicit function declaration and incompatible pointer types

Open dcstes opened this issue 9 months ago • 3 comments

The C source code of OpenSmalltalk (and traditional Squeak VM) is sometimes using functions that are implicitly declared.

Also there are times when arguments are of incompatible pointer types.

Large parts of the C source code of Squeak and OpenSmalltalk are maintained in "VMMaker" and are automatically generated as can be seen in the headers of the files in the github opensmalltalk-vm repository.

There are often comments like "Automatically generated by CCodeGeneratorGlobalStructure VMMaker.oscog", meaning that the C file is actually automatically generated by Smalltalk VMMaker.

Sometimes however, the implicit function declaration or incompatible pointer type argument is in the "plugin" directory of the platform specific directory, and it is simply in C handcoded code.

The goal of this github issue is to request that some work is done (and I realise this is a huge effort) on fixing the implicit function declarations and pointer types, but of course preferably in a gradual way without breaking backward compatibility and without causing problems for existing compilation/build on the Squeak/OpenSmalltalk platforms.

In many cases the problems can be "harmless" but sometimes there are perhaps real bugs due to the implicit function declarations/incompatible pointer types.

I'm flagging this issue as Feature because arguably it is not really a bug that the C code of OpenSmalltalk has examples of these "implicit function declarations" (which are documented and well defined by the C language such as discussed in the book by Kernighan and Ritchie on the C language).

dcstes avatar Apr 11 '25 19:04 dcstes

The fewer "implicit" functions, the better.

krono avatar Apr 11 '25 19:04 krono

On Solaris or on Linux openSUSE "TumbleWeed", gcc 14.2.1 currently warns on those implicit function declarations if "gcc -fpermissive" is used. The OpenSmalltalk vm can be built with gcc 14.2.1 following the instructions at https://gcc.gnu.org/gcc-14/porting_to.html#warnings-as-errors

dcstes avatar Apr 21 '25 17:04 dcstes

Same issue with gcc 15.0.1 on SUSE Leap 16.0. Using "gcc -fpermissive" with gcc 15.0.1 succesfully builds OpenSmalltalk.

dcstes avatar Apr 28 '25 17:04 dcstes