Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: vallor Newsgroups: comp.os.linux.misc Subject: Re: Compiler utility Date: 7 Feb 2025 17:51:44 GMT Lines: 77 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net xacPRlgsJK7rZB/4j78lcw5b74DyxmbJZbO9EH/rwacHqCqInp Cancel-Lock: sha1:G1Kkkaw4XQfV8fS4QP8iojxd8us= sha256:OzBFo0+9vC/isK/FsAJY+dqKtoGpse+mGgOm/XTwmRI= X-Face: +McU)#<-H?9lTb(Th!zR`EpVrp<0)1p5CmPu.kOscy8LRp_\u`:tW;dxPo./(fCl CaKku`)]}.V/"6rISCIDP` User-Agent: Pan/0.161 (Hmm2; b3261289; Linux-6.13.1) Xref: csiph.com comp.os.linux.misc:65258 On Fri, 7 Feb 2025 17:35:43 -0000 (UTC), root wrote in : > vallor 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 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 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!"