all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Use of %td in printf
@ 2019-07-03  6:03 Eli Zaretskii
  2019-07-03  7:33 ` Paul Eggert
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2019-07-03  6:03 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

Commit c136f93d causes us use %td in printf formats, but is that
feature portable enough?  (Admittedly, the code which uses that is
usually not compiled in, but still.)



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Use of %td in printf
  2019-07-03  6:03 Use of %td in printf Eli Zaretskii
@ 2019-07-03  7:33 ` Paul Eggert
  2019-07-03  7:44   ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Eggert @ 2019-07-03  7:33 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii wrote:
> Commit c136f93d causes us use %td in printf formats, but is that
> feature portable enough?

Yes. %td is in C99 and Emacs has been using the feature for some time (Emacs 26 
uses it).



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Use of %td in printf
  2019-07-03  7:33 ` Paul Eggert
@ 2019-07-03  7:44   ` Eli Zaretskii
  2019-07-03  8:04     ` Paul Eggert
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2019-07-03  7:44 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

> Cc: emacs-devel@gnu.org
> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Wed, 3 Jul 2019 00:33:42 -0700
> 
> Eli Zaretskii wrote:
> > Commit c136f93d causes us use %td in printf formats, but is that
> > feature portable enough?
> 
> Yes. %td is in C99 and Emacs has been using the feature for some time (Emacs 26 
> uses it).

AFAIR, we require a C99 compiler, but not a C99 C library.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Use of %td in printf
  2019-07-03  7:44   ` Eli Zaretskii
@ 2019-07-03  8:04     ` Paul Eggert
  2019-07-03  8:31       ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Eggert @ 2019-07-03  8:04 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii wrote:
> AFAIR, we require a C99 compiler, but not a C99 C library.

That was a while ago. These days it's safe to assume %td and Emacs has been 
doing so for some time without any problems.

I should mention that the situation is more complicated than "we require a C99 
compiler". Emacs does not require full support for C99, either in the compiler 
or the library. (If it did, we couldn't use Microsoft's C compiler, which does 
not support all of C99.) Emacs does assume many C99 features, though, and %td 
has been one of these features for a while.

While we're on the topic, one of these days I was thinking of removing 
printmax_t and related types and macros from src/lisp.h, as %jd is considerably 
simpler and should be universal by now. Even when I added that stuff back in 
2011 the concern about portability to old C libraries lacking %jd support was 
mostly theoretical; I think the last holdout was Solaris 8, which Oracle stopped 
supporting in 2012. Nowadays those pre-C99 libraries are museum pieces and we 
can drop the printmax_t hacks.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Use of %td in printf
  2019-07-03  8:04     ` Paul Eggert
@ 2019-07-03  8:31       ` Eli Zaretskii
  0 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2019-07-03  8:31 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

> Cc: emacs-devel@gnu.org
> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Wed, 3 Jul 2019 01:04:33 -0700
> 
> Eli Zaretskii wrote:
> > AFAIR, we require a C99 compiler, but not a C99 C library.
> 
> That was a while ago. These days it's safe to assume %td and Emacs has been 
> doing so for some time without any problems.

Thanks, I just wanted to be sure.  I don't really know of any platform
where this could cause problems.

> I should mention that the situation is more complicated than "we require a C99 
> compiler". Emacs does not require full support for C99, either in the compiler 
> or the library. (If it did, we couldn't use Microsoft's C compiler, which does 
> not support all of C99.)

We don't support building with the Microsoft compiler for quite some
time now.  The MS-Windows port is built using GCC, not MSVC.

> While we're on the topic, one of these days I was thinking of removing 
> printmax_t and related types and macros from src/lisp.h, as %jd is considerably 
> simpler and should be universal by now. Even when I added that stuff back in 
> 2011 the concern about portability to old C libraries lacking %jd support was 
> mostly theoretical; I think the last holdout was Solaris 8, which Oracle stopped 
> supporting in 2012. Nowadays those pre-C99 libraries are museum pieces and we 
> can drop the printmax_t hacks.

If all the platforms we care about support that, fine.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-07-03  8:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-03  6:03 Use of %td in printf Eli Zaretskii
2019-07-03  7:33 ` Paul Eggert
2019-07-03  7:44   ` Eli Zaretskii
2019-07-03  8:04     ` Paul Eggert
2019-07-03  8:31       ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.