Janet Cobb via agora-discussion [2025-07-21 19:32]:
> On 7/21/25 19:30, Mischief via agora-discussion wrote:
> > On 7/21/25 12:09 PM, juan via agora-business wrote:
> >> Cosmo via agora-official [2025-07-20 23:29]:
> >>> I initiate a referendum on each of the following proposals, removing
> >>> them from the proposal pool. […]
> >> I do the actions specified in the document that is formed by the output
> >> of the following C program as compiled by the ANSI standard:
> >>
> >> {
> >> main(){char i;for (i = 0; i < 7; i++){printf("I vote FOR %d.\n", 9234 + 
> >> i);}}
> >> }
> > P9240 hasn't been distributed yet.
> >
> > (Also, gcc wouldn't compile this as-is for me since it wanted cstdio 
> > #include'd.)
> >
> 
> Yes, under the standard, this is ill-formed. I think those votes fail.

Ok, this is a problem. Look:

```
$ gcc -pedantic -ansi votes.c -o votes
votes.c: In function 'main':
votes.c:1:39: warning: incompatible implicit declaration of built-in function 
'printf' [-Wbuiltin-declaration-mismatch]
    1 | main(){char i;for (i = 0; i < 7; i++){printf("I vote FOR %d.\n", 9234 + 
i);}}
      |                                       ^~~~~~
votes.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | main(){char i;for (i = 0; i < 7; i++){printf("I vote FOR %d.\n", 9234 + 
i);}}
$ ./votes
I vote FOR 9234.
I vote FOR 9235.
I vote FOR 9236.
I vote FOR 9237.
I vote FOR 9238.
I vote FOR 9239.
I vote FOR 9240.
```

It's just a warning, so it should work. And, in my machine, it does.

Also, not that this is authoritative, but see:
https://stackoverflow.com/a/9182835/11672072.

-- 
juan

Reply via email to