Check all errors in code?

V

vippstar

How would it break? Even if a macro definition of strtol is provided, it
must also be available as a declaration of an actual function, just like
almost all other standard library functions.


It wouldn't. I realized a bit after I made my post :-(.
 
N

Nick Keighley

Whilst 0 is a common return value for atoi when its input can't be
represented as an int, the Standard doesn't mandate this, so code that
relies on it is broken.

wow. My first thought was "Richard must be wrong anout this. I'm
certain
atoi() returns zero on error". So I checked. It really is UB if atoi()
cannot perform the conversion! So I learned something new about C
today!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top