Sujet : Re: Compiler utility
De : vallor (at) *nospam* cultnix.org (vallor)
Groupes : comp.os.linux.miscDate : 07. Feb 2025, 18:51:44
Autres entêtes
Message-ID : <m0mvhfFakt5U2@mid.individual.net>
References : 1 2 3
User-Agent : Pan/0.161 (Hmm2; b3261289; Linux-6.13.1)
On Fri, 7 Feb 2025 17:35:43 -0000 (UTC), root <
NoEMail@home.org> wrote in
<
vo5g9e$3jith$1@dont-email.me>:
vallor <vallor@cultnix.org> wrote:
>
You can probably get the code to compile with the proper "--std="
directive to gcc.
>
>
I tried std=gnu89, but that didn't fix the problem.
A really strange thing: one of my old programs had a list of routines at
the front, with entries like:
int main ();
void this();
etc.
when the compiler encountered the line
int main(argc,argv)
it threw up an error.
Not sure what would be going on there.
$ cat try.c
#include <stdio.h>
int main();
void this();
int main(argc,argv)
int argc;
char ** argv;
{
printf("%s\n","Does this work?");
return 0;
}
$ make try
cc "-std=gnu89" try.c -o try
$ ./try
Does this work?
$ cat try2.c
#include <stdio.h>
int main();
void this();
int main(argc,argv)
/*int argc;
char ** argv;*/
{
printf("%s\n","Does this work?");
return 0;
}
$ make try2
cc "-std=gnu89" try2.c -o try2
$ ./try2
Does this work?
$ gcc --version
gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
-- -v System76 Thelio Mega v1.1 x86_64 NVIDIA RTX 3090 Ti OS: Linux 6.13.1 Release: Mint 22.1 Mem: 258G "Come any closer and I'll use my magnet!"