calculate value of 73!

T

Tom St Denis

Sidney Cadot said:
Arthur said:
jacob navia wrote:

[re someone's saying his implementation encroached user namespaces]
Did you overlooked
#include <qfloat.h>
???
Nothing invades the user names space unless he/she wants it so.

Fair enough. However, your program invokes UB in both C and C++ by using
%qf in a printf formatting string, I believe.


Well, duh. His program invokes undefined behavior, or at least
implementation-specified behavior (I don't feel like checking), by
#including <qfloat.h> in the first place.

You don't know that, since you haven't seen qfloat.h (it may be
perfectly compliant). All we know is that UB is introduced by the printf
format string.

First line of qfloat.h

#define printf qfloat_compatible_printf

;-)

Tom
 
M

Mark Shelor

Richard said:
Isn't that just a touch on the churlish side, Pete (albeit correct!)?

For the record, I thought Mark's reply was superb.


A very kind remark, Richard. Thank you. I've also added a splendid
adjective to my vocabulary ;)

Truthfully, though, I was ignorant of EXIT_SUCCESS and EXIT_FAILURE, so
thanks also to Pete for pointing this out.

Regards, Mark
 
R

Richard Bos

Sidney Cadot said:
You don't know that, since you haven't seen qfloat.h (it may be
perfectly compliant).

Imprimis, he didn't show us his qfloat.h, so the program _as posted_
invokes non-defined, IIRC undefined, behaviour.
Secundis, you can't definedly use <> with your own headers; only the
Standard headers are guaranteed to be useable that way. "qfloat.h" is
also not quite guaranteed to be found, but there are more requirements
for the search in that case.

Richard
 

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,139
Messages
2,570,805
Members
47,355
Latest member
MavoraTech

Latest Threads

Top