[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/1] config.guess: Use int
From: |
Petr Vorel |
Subject: |
Re: [PATCH 1/1] config.guess: Use int |
Date: |
Wed, 3 Apr 2024 19:49:53 +0200 |
Hi Zack,
[ Cc Ben, author of the code I refer below ]
> On Wed, Apr 3, 2024, at 1:01 PM, Petr Vorel wrote:
> > Although -Wmain-return-type is not considered as error (unlike
> > -Wimplicit-int on gcc 14 and clang 16), but just a warning, let's fix it
> > for the future.
> > <stdin>:1:1: warning: return type of 'main' is not 'int'
> > [-Wmain-return-type]
> I agree we should make this change, but...
> > - main()
> > + int main()
> please *don't* put the return type on the same line as the function name,
> and change the argument list to `(void)` while you're touching this.
> We want the end result to be
> int
> main (void)
Sure, I'll do it in v2. May I know the reason for this?
Does this rule (return type on a separate line) applies to main
with args (Ben is the author)?
mips:*:*:UMIPS | mips:*:*:RISCos)
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
> > - int
> > - main ()
> > + int main ()
> same here
+1
Kind regards,
Petr
> zw