emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-24 r117080: * internals.texi (C Dialect): New sectio


From: Paul Eggert
Subject: [Emacs-diffs] emacs-24 r117080: * internals.texi (C Dialect): New section.
Date: Wed, 07 May 2014 20:51:38 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117080
revision-id: address@hidden
parent: address@hidden
committer: Paul Eggert <address@hidden>
branch nick: emacs-24
timestamp: Wed 2014-05-07 13:51:35 -0700
message:
  * internals.texi (C Dialect): New section.
  
  (C Integer Types): Mention bool_bf.
modified:
  doc/lispref/ChangeLog          changelog-20091113204419-o5vbwnq5f7feedwu-6155
  doc/lispref/internals.texi     
internals.texi-20091113204419-o5vbwnq5f7feedwu-6188
=== modified file 'doc/lispref/ChangeLog'
--- a/doc/lispref/ChangeLog     2014-04-29 04:14:27 +0000
+++ b/doc/lispref/ChangeLog     2014-05-07 20:51:35 +0000
@@ -1,3 +1,8 @@
+2014-05-07  Paul Eggert  <address@hidden>
+
+       * internals.texi (C Dialect): New section.
+       (C Integer Types): Mention bool_bf.
+
 2014-04-29  Stefan Monnier  <address@hidden>
 
        * processes.texi (Filter Functions, Sentinels): Advertise add-function.

=== modified file 'doc/lispref/internals.texi'
--- a/doc/lispref/internals.texi        2014-04-21 14:50:19 +0000
+++ b/doc/lispref/internals.texi        2014-05-07 20:51:35 +0000
@@ -15,6 +15,7 @@
 * Pure Storage::        Kludge to make preloaded Lisp functions shareable.
 * Garbage Collection::  Reclaiming space for Lisp objects no longer used.
 * Memory Usage::        Info about total size of Lisp objects made so far.
+* C Dialect::           What C variant Emacs is written in.
 * Writing Emacs Primitives::   Writing C code for Emacs.
 * Object Internals::    Data formats of buffers, windows, processes.
 * C Integer Types::     How C integer types are used inside Emacs.
@@ -575,6 +576,20 @@
 Emacs session.
 @end defvar
 
address@hidden C Dialect
address@hidden C Dialect
address@hidden C programming language
+
+The C part of Emacs is portable to C89: C99-specific features such as
address@hidden<stdbool.h>} and @samp{inline} are not used without a check,
+typically at configuration time, and the Emacs build procedure
+provides a substitute implementation if necessary.  Some C99 features,
+such as declarations after statements, are too difficult to provide
+substitutes for, so they are avoided entirely.
+
+At some point in the not-too-distant future the base C dialect will
+change from C89 to C99, and eventually it will no doubt change to C11.
+
 @node Writing Emacs Primitives
 @section Writing Emacs Primitives
 @cindex primitive function internals
@@ -1616,12 +1631,6 @@
 signed integer value.
 
 @item
-In bitfields, prefer @code{unsigned int} or @code{signed int} to
address@hidden, as @code{int} is less portable: it might be signed, and
-might not be.  Single-bit bit fields are invariably @code{unsigned
-int} so that their values are 0 and 1.
-
address@hidden
 Prefer @code{bool}, @code{false} and @code{true} for booleans.
 Using @code{bool} can make programs easier to read and a bit faster than
 using @code{int}.  Although it is also OK to use @code{int}, @code{0}
@@ -1629,7 +1638,15 @@
 using @code{bool}, respect the limitations of the replacement
 implementation of @code{bool}, as documented in the source file
 @file{lib/stdbool.in.h}, so that Emacs remains portable to pre-C99
-platforms.
+platforms.  In particular, boolean bitfields should be of type
address@hidden, not @code{bool}, so that they work correctly even when
+compiling Objective C with standard GCC.
+
address@hidden
+In bitfields, prefer @code{unsigned int} or @code{signed int} to
address@hidden, as @code{int} is less portable: it might be signed, and
+might not be.  Single-bit bit fields should be @code{unsigned int} or
address@hidden so that their values are 0 or 1.
 @end itemize
 
 @c FIXME Mention src/globals.h somewhere in this file?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]