This is the mail archive of the mailing list for the newlib project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [PATCH] Inline defn's in stdio.h break gcc bootstrap on cygwin.

On 29 March 2007 17:04, Jeff Johnston wrote:

> This won't be a problem to anything but Cygwin.  If you notice, the
> inlined functions in question are brought in only when the __SCLE flag
> is set which is done at the top of stdio.h iff __CYGWIN__ is defined.

  Great.  I decided to move the whole thing just inside the #ifdef __SCLE,
where before the ELIDABLE_INLINE definition was only inside the enclosing
#ifndef __CUSTOM_FILE_IO__, but there's no need for it anywhere else.

> Now, regarding the patch.  The macro should be _ELIDABLE_INLINE instead
> of ELIDABLE_INLINE to avoid conflicts with the user name-space.  The
> patch should use __inline__ instead of inline in case the user uses the
> -ansi flag.  

  Done and done.

> I might suggest adding to the comment for clarification.
> For example:  "For a platform with CR/LF, additional logic is required
> by __sgetc_r which would otherwise simply be a macro; therefore we use
> an inlined function.  The function is only meant to be inlined in place
> as used and the function body should never be emitted.  There are two
> possible scenarios....explanation of C99 etc...."

  Extended with just those words.  It's quite a big comment now, feel free to
trim it down if you'd prefer.

> Once these things are fixed, the patch is approved.

2007-03-30  Dave Korn  <>

	* libc/include/stdio.h (_ELIDABLE_INLINE):  New macro to conceal
	conflicting inline semantics between C99 and GNU89.
	(__sgetc_r):  Replace static inline with _ELIDABLE_INLINE to be
	compatible with -fkeep-inline-functions usage.
	(__sputc_r):  Likewise for consistency even though disabled.

  Retested that cygwin dll still builds, verified that it solves bootstrap
failure for gcc, and checked in.  Thanks Jeff!

Can't think of a witty .sigline today....

Attachment: checked-diffs.txt
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]