Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
irishcoffee
· 10mo ago · 0 comments
This is interesting, but I wouldn't say it is valid C. main() doesn't know about greet(auto s) and wouldn't be able to call it in valid C89, right?
Comments
[–]
kevin_thibedeau
10mo ago
It's valid K&R since everything defaults to int. The linker will match the symbols sans prototype. That wasn't obsoleted until C23.
[–]
irishcoffee
OP
10mo ago
TIL, thank you! (How embarrassing haha)
[–]
oguz-ismail2
10mo ago
It is valid C89. greet is automatically declared as
int greet();
at call site.