🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #659

Re: Taming The Switch-Statement

#659
From: Scott Lurndal
Date: Wed, 21 Oct 2026 19:17
41 lines
2632 bytes
bart <bc@freeuk.com> writes:
>On 21/10/2026 18:21, Scott Lurndal wrote:
>> bart <bc@freeuk.com> writes:
>>> On 21/10/2026 16:37, Dan Cross wrote:
>> 
>>>> You can write some library in BartM or whatever language you
>>>> like, and someone might write a binding to call it from, say,
>>>> Pascal; and then a year down the road, you might change your
>>>> compiler (since I gather you don't bother with a well-defined
>>>> ABI, based on your not seeming to understand
>>>
>>> You still don't get what an ABI is.
>> 
>> Please, enlighten us.  Be specific.  What exactly
>> does the term ABI mean to you?
>
>It's what I have to deal with in a compiler back-end if I want to 
>support an FFI in a language.

Ah, so you don't know what an ABI is.

   An Application Binary Interface (ABI) is a
   low-level contract in computer science that
   defines how two compiled binary program modules
   interact with each other at the machine-code level.

<snip discussions of the well known ABI requirements for
 windows x86_64 and linux on ARM64>[*]

If you want your compiler to leverage existing libraries
and/or code written in another language, you need to follow
the platform ABI.  It is that simple.

Whether you like it or not, is completely irrelevent.

[*] It is worth noting that the Windows x86 64-bit ABI
requirement for the caller to reserve space for the
callee to save registers (shadow store) is quite
unusual in modern ABIs.

The stack pointer alignment requirement should be obvious.
Technical Details
Message-ID: <Pc8CS.30541$sfD.17299@fx03.iad>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!npeer.as286.net!npeer-ng0.as286.net!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx03.iad.POSTED!not-for-mail
References: <119qf6l$2rmg3$1@dont-email.me> <11b933e$3h3d0$1@dont-email.me> <11ba78m$3peq3$3@dont-email.me> <11baiuc$11ac$1@dont-email.me> <11bam77$6at$1@reader2.panix.com> <11baot1$3j98$1@dont-email.me> <aw6CS.179415$PnNb.56673@fx12.iad> <11baur1$63id$1@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!npeer.as286.net!npeer-ng0.as286.net!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx03.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Taming The Switch-Statement
Newsgroups: comp.lang.c
References: <119qf6l$2rmg3$1@dont-email.me> <11b933e$3h3d0$1@dont-email.me> <11ba78m$3peq3$3@dont-email.me> <11baiuc$11ac$1@dont-email.me> <11bam77$6at$1@reader2.panix.com> <11baot1$3j98$1@dont-email.me> <aw6CS.179415$PnNb.56673@fx12.iad> <11baur1$63id$1@dont-email.me>
Lines: 41
Message-ID: <Pc8CS.30541$sfD.17299@fx03.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Wed, 21 Oct 2026 19:17:03 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Wed, 21 Oct 2026 19:17:03 GMT
X-Received-Bytes: 2403