Re: Compiler utility

Liste des GroupesRevenir à col misc 
Sujet : Re: Compiler utility
De : vallor (at) *nospam* cultnix.org (vallor)
Groupes : comp.os.linux.misc
Date : 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!"

Date Sujet#  Auteur
7 Feb 25 * Compiler utility16root
7 Feb 25 +* Re: Compiler utility9vallor
7 Feb 25 i+- Re: Compiler utility1rbowman
7 Feb 25 i`* Re: Compiler utility7root
7 Feb 25 i +- Re: Compiler utility1vallor
7 Feb 25 i `* Re: Compiler utility5The Natural Philosopher
7 Feb 25 i  +* Re: Compiler utility3Lew Pitcher
8 Feb 25 i  i+- Re: Compiler utility1Lawrence D'Oliveiro
8 Feb 25 i  i`- Re: Compiler utility1The Natural Philosopher
9 Feb 25 i  `- Re: Compiler utility1root
7 Feb 25 +* Re: Compiler utility2Lawrence D'Oliveiro
7 Feb 25 i`- Re: Compiler utility1WokieSux282@ud0s4.net
7 Feb 25 `* Re: Compiler utility4Richard Kettlewell
7 Feb 25  `* Re: Compiler utility3root
7 Feb 25   `* Re: Compiler utility2Richard Kettlewell
7 Feb 25    `- Re: Compiler utility1root

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal