Click here to Skip to main content
15,906,816 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: missing "return" crash ... Pin
Rick York24-Apr-24 10:02
mveRick York24-Apr-24 10:02 
GeneralRe: missing "return" crash ... Pin
Jeremy Falcon24-Apr-24 11:37
professionalJeremy Falcon24-Apr-24 11:37 
GeneralRe: missing "return" crash ... Pin
MarkTJohnson25-Apr-24 3:10
professionalMarkTJohnson25-Apr-24 3:10 
GeneralRe: missing "return" crash ... Pin
Salvatore Terress24-Apr-24 16:11
Salvatore Terress24-Apr-24 16:11 
GeneralRe: missing "return" crash ... Pin
Maximilien24-Apr-24 7:45
Maximilien24-Apr-24 7:45 
GeneralRe: missing "return" crash ... Pin
Jeremy Falcon24-Apr-24 11:36
professionalJeremy Falcon24-Apr-24 11:36 
GeneralRe: missing "return" crash ... Pin
Nelek25-Apr-24 9:09
protectorNelek25-Apr-24 9:09 
GeneralRe: missing "return" crash ... Pin
jschell24-Apr-24 13:01
jschell24-Apr-24 13:01 
Seems like something like this question was discussed not that long ago.


Salvatore Terress wrote:
define C function to return int...


So C and not C++.

Per the following at least as far as the C11 spec this is allowed. I did not verify the spec myself.

https://stackoverflow.com/questions/10079089/implicit-int-return-value-of-c-function[^]

As several replies suggest the behavior is undefined however if the caller attempts to use the value. That of course would include crashing.

But there could be other reasons for it crashing.
GeneralWordle 1040 Pin
GKP199223-Apr-24 17:15
professionalGKP199223-Apr-24 17:15 
GeneralRe: Wordle 1040 Pin
Shane010323-Apr-24 17:57
Shane010323-Apr-24 17:57 
GeneralRe: Wordle 1040 Pin
Amarnath S23-Apr-24 19:36
professionalAmarnath S23-Apr-24 19:36 
GeneralRe: Wordle 1040 - 4 4 me Pin
pkfox23-Apr-24 20:10
professionalpkfox23-Apr-24 20:10 
GeneralRe: Wordle 1040 Pin
ChandraRam23-Apr-24 20:13
ChandraRam23-Apr-24 20:13 
GeneralRe: Wordle 1040 Pin
OriginalGriff23-Apr-24 20:36
mveOriginalGriff23-Apr-24 20:36 
GeneralRe: Wordle 1040 Pin
Sander Rossel23-Apr-24 22:20
professionalSander Rossel23-Apr-24 22:20 
GeneralRe: Wordle 1040 Pin
Cp-Coder23-Apr-24 23:51
Cp-Coder23-Apr-24 23:51 
GeneralRe: Wordle 1040 Pin
StarNamer@work24-Apr-24 1:58
professionalStarNamer@work24-Apr-24 1:58 
GeneralHollydeadwood Pin
BernardIE531723-Apr-24 16:35
BernardIE531723-Apr-24 16:35 
GeneralRe: Hollydeadwood Pin
Jeremy Falcon23-Apr-24 17:57
professionalJeremy Falcon23-Apr-24 17:57 
GeneralRe: Hollydeadwood Pin
Amarnath S23-Apr-24 18:33
professionalAmarnath S23-Apr-24 18:33 
GeneralRe: Hollydeadwood Pin
dandy7224-Apr-24 3:27
dandy7224-Apr-24 3:27 
GeneralI didn't believe it Pin
jschell23-Apr-24 15:05
jschell23-Apr-24 15:05 
GeneralRe: I didn't believe it Pin
Mircea Neacsu23-Apr-24 15:16
Mircea Neacsu23-Apr-24 15:16 
GeneralRe: I didn't believe it Pin
enhzflep24-Apr-24 21:05
enhzflep24-Apr-24 21:05 
GeneralRe: I didn't believe it Pin
Mircea Neacsu25-Apr-24 2:12
Mircea Neacsu25-Apr-24 2:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.