Yo Hal!

On Tue, 18 Nov 2025 22:30:10 -0800
Hal Murray <[email protected]> wrote:

> [email protected] said:
> > The standard approach is:
> >   Use %d for int, %ld for long.
> >   Use PRI macros for other types.   
> 
> I find the PRI stuff hard to read.  Maybe I just need more practice.
> I'd much rather cast the parameter to a long.

Which fails.  And a very common failure in submitted code.  You need
to  reach for (long long) often.

> So, other than printf, are there any serous problems?

Yes.  We often use casts to avoid compiler warnings, and is not obvious
what the best cast is for 32-bit and 64-bit compatibilty, As proven
in this thead by you and Greg reaching for (long) when you need (long
long).  size_t and ssize_t almost always cause warnings in new code.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        [email protected]  Tel:+1 541 382 8588

            Veritas liberabit vos. -- Quid est veritas?
    "If you can't measure it, you can't improve it." - Lord Kelvin

Attachment: pgpUXgpHRFsQg.pgp
Description: OpenPGP digital signature

Reply via email to