[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Inlcude the Squeak headers after the C headers. This hsould also help fix (47b8d52)

Eliot Miranda notifications at github.com
Mon Sep 28 13:53:51 UTC 2020


The point is, Tobias, that the flag must de defined on the command line, that some flags must be defined in the command line.

Further, the architectural pic t is that C headers are white box.  They cannot provide encapsulation.  Therefore when one includes a C header one is including implementation as well as API.  Therefore, if one is only to see API one should not attempt to modify those headers prior to their inclusion other than by platform aprtoced Flags, such as _GNU_SOURCE, since otherwise one risks alteration in a way that will break later when the C header is modified.

This is exactly the case with my having to redefine the stellar define so that it avoided breaking a specific platform’s implementation of the redirect from abstract file offsets (ftell) to concrete 64-bit offsets.

The point is that architecturally a C file that is part of an application is compiled within an environment provided by a platform (different versions of macOS, Linux, Windows, etc, with different processors, etc) and that config.h serves *not* to alter that environment, but to provide ab abstract definition of the facilities provided by that platform.  Therefore it is completely backwards to use config.h in any way to alter system includes.  config.h tells one what is inside without having to look.  configure does (expensive slow) black box testing on them to derive config.h.  config.g is designed to inform the program of the facilities provided by the includes, not to be abused to modify those includes.

Therefore, the correct way to select between different alternatives a specific platform provides (32-bit vs 64-bit, c99 vs C11 vs C18, POSIX vs GNU, etc, is *external to the source code*.  That means on the command line, issues either from a build environment or makefiles.

So given that one must and should use command line selection of alternatives can we please Adams in this idea of including our own header before everything else?  C/C++/Objective-C etc are not designed to be written or compiled in this way.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/47b8d5202b835b5d9d1556ed0cf0dda11e5b246c#commitcomment-42784994
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20200928/4a009da7/attachment-0001.html>


More information about the Vm-dev mailing list