On 7/27/25 12:17 PM, Katherina Walshe-Grey via agora-official wrote:
Janet wrote:
I initiate a CFJ on the following statement: "juan has a valid ballot
on the referendum on Proposal 9234."
This is CFJ 4119. I assign it to Trigon.
To get this out of the way, the phrase "ANSI C" in this case is
sufficient to specify the C89 standard as specified by the American
National Standards Institute in ANSI X3.159-1989, a draft of which can
be found in [1].
The program in question, for completeness' sake, is as follows:
```
main(){char i;for (i = 0; i < 7; i++){printf("I vote FOR %d.\n", 9234 +
i);}}
```
Out of curiosity, I ran the program through a variety of ANSI C
compilers. Running the executable created by all of the following
compilers produced the same output, to the byte:
```
$ gcc -std=c89 votes.c -o gcc # [2]
$ clang -std=c89 votes.c -o llvm # [3]
$ tcc -std=c89 votes.c -o tcc # [4]
$ zig cc -std=c89 votes.c -o zig # [5]
```
The code does compile and produce the expected output when run through
many C compilers that implement the ANSI standard. This does not,
however, conclusively prove that the action worked, or even that the
program is well-formed. I was unable to compile the code using
ChibiCC [6] or swcc [7]; however, these do not aim for C89 support, so
they are not considered.
There were three main challenges to the program itself, presented
somewhat out of order for clarity
First, the elision of the return type of the function [8]. This is
well-defined behavior by the C89 standard. When no return type is
declared, `int` is assumed [1 § 3.7.1]. This court finds that this
challenge does not invalidate the program.
Second, the potential failure of `printf` [9]. Janet contends that the
program has no defined output because any one of the calls to `printf`
may fail. In the Agoran spirit of reasonability regarding the
interpretation of players' actions, this court finds that a reasonably
functional output stream may be assumed for the purpose of interpreting
a program.
Third, the implicit definition of `printf` [9]. Janet points out that
including functions with variadic arguments without a prototype is
undefined behavior in C89 [1 § 3.3.2.2], however, as demonstrated
above, a large number of independently-developed C compilers allow the
implicit definition of some or all standard library functions. Is it
therefore reasonable to accept the program with no inclusion of the
`stdio.h` header? This court finds that it is not.
Although many compilers supporting ANSI C do compile the code and
produce the same output as each other, it is possible that a player may
only have access to a compiler that, while it supports ANSI C, does not
allow this behavior. This is especially true given that, although
contemporary solutions tend to accept the program, there is no saying
what compilers may support in the future, where the interpretation of
whether these actions succeed may still be relevant.
I judge FALSE.
As for whether code whose behavior is well-defined would work, this is
fairly clearly covered by the landmark case CFJ 1460 [10], which states
that players shall not be required to respond to actions taken in a
language they don't understand or otherwise take unreasonable effort to
interpret.
This attitude is further reaffirmed in CFJ 3663 [11], which contains
tests for jargon used by Agorans. Although it would be a stretch to call
the C language "jargon", I find the first (given in the addendum)
relevant:
> Is the Jargon in a Document that is public in content that has a firm
> legal status resistant to change (i.e. tracked by Agora, or prevented
> from changing without reasonable notice)?
The C language standard drafts are public, but the actual standards are
paid (and the C89 standard in particular is not even available
anymore) [12]. Furthermore, the standard is dense and often difficult to
parse, even for technically-literate Agorans such as Janet and myself.
Even if the actual standard were open and available for download, it is
only fair that documents defining information for use by the Agoran
public should be held to the same standards of being reasonably clear
to the average Agoran.
While well-defined programs can simply be compiled to achieve a specific
output, unlike natural languages, the process of compilation may not
even be familiar to someone who has not programmed before, and
furthermore, even if the player is familiar with the language, proving
that a program has no undefined behavior is not a reasonable level of
effort to require from basically any Agoran just to interpret an action.
[1] https://port70.net/~nsz/c/c89/c89-draft.html
[2] https://gcc.gnu.org/
[3] https://clang.llvm.org/
[4] https://bellard.org/tcc/
[5] https://ziglang.org/
[6] https://github.com/rui314/chibicc
[7] https://github.com/jyn514/saltwater
[8]
https://mailman.agoranomic.org/cgi-bin/mailman/private/agora-discussion/2025-July/064934.html
[9]
https://mailman.agoranomic.org/cgi-bin/mailman/private/agora-business/2025-July/054496.html
[10] https://agoranomic.org/cases/?1460
[11] https://agoranomic.org/cases/?3663
[12] https://iso-9899.info/wiki/The_Standard
--
Trigon
Popular Polygon and Treasuror Extraordinaire