Re: [patch] cat's main never return

2015-08-30 Thread Theo de Raadt
> HH+mL2X2OVWv/V6+vyUac3lBVYNtF0ckcyZVDW09ooK8WUpBSk3Jbq4X5HLdyVeD2ynbDF+Kj > qHSHpFm00Yd1UoQYYAWk2+Mmx2PZwJ+rN6oh3m90NNDl4M6TtaVhZPKg9jJzYMVnYwOE= > > On Sat, Aug 29, 2015 at 05:02:33PM -0600, Theo de Raadt wrote: > > It really does not matter. Coder's choice. The result is the same. > > You

Re: [patch] cat's main never return

2015-08-30 Thread Tobias Stoeckmann
On Sat, Aug 29, 2015 at 05:02:33PM -0600, Theo de Raadt wrote: > It really does not matter. Coder's choice. The result is the same. > You could hunt them all down, change them all, save a few code bytes, > but don't you dare introduce any bugs... The main function is called by crt0 like exit

Re: [patch] cat's main never return

2015-08-29 Thread Theo de Raadt
> just saw that cat's *main* function does never return even though there is a > return value, > exit(3) is called instead. > Is there any reason why or is it just historically, cause it's a bit > confusing? > If exit(3) is always called, than why not changing the return value to *void*? > > Oth

Re: [patch] cat's main never return

2015-08-29 Thread Joerg Sonnenberger
On Sun, Aug 30, 2015 at 12:10:03AM +0200, Fritjof Bornebusch wrote: > If exit(3) is always called, than why not changing the return value to *void*? Because ISO C says that in non-freestanding environment, main should retutrn int. Joerg

[patch] cat's main never return

2015-08-29 Thread Fritjof Bornebusch
Hi, just saw that cat's *main* function does never return even though there is a return value, exit(3) is called instead. Is there any reason why or is it just historically, cause it's a bit confusing? If exit(3) is always called, than why not changing the return value to *void*? Other calls in