C99 assert

Eric Blake ebb9@byu.net
Wed Jun 27 00:57:00 GMT 2007

Hash: SHA1

According to Eric Blake on 6/26/2007 2:07 PM:
> Jeff Johnston <jjohnstn <at> redhat.com> writes:
[see thread at http://sourceware.org/ml/newlib/2007/msg00763.html -
cygwin's assert currently doesn't comply with POSIX]
>> Hi Eric,
>>    I'd like to see backward-compatiblity to be the old-style message 
>> format.  I don't see the point of saying: function <blank>.  So, old 
>> compiled calls to __assert would behave as they always have.  Similarly, 
>> for systems without function capability, I would like to use the old 
>> message format.  My take would be to have both __assert and 
>> __assert_func and have assert map to the appropriate call.  I also think 
>> that the function should be quoted or you should use a colon (e.g. 
>> function: getparms) for clarification.
> How about the following, then?
> 2007-06-26  Eric Blake  <ebb9@byu.net>
> 	Support __func__ in assert, as required by C99.
> 	* libc/stdlib/assert.c (__assert_func): New function.
> 	(__assert): Use __assert_func.
> 	* libc/include/assert.h (assert) [!NDEBUG]: Use __assert_func when
> 	possible.

If I check in just the above newlib patch, CVS cygwin will be broken when
trying to use assert (and simply exporting __assert_func won't help, since
cygwin's assert.cc must provide all symbols present in newlib's assert.c).
 Likewise, this patch without newlib would break (because assert.h is
maintained by newlib).  So, is it OK to apply this patch at the same time
as the newlib patch, to avoid breakage?

2007-06-26  Eric Blake  <ebb9@byu.net>

	* assert.cc (__assert_func): New function, to match newlib header
	* cygwin.din: Export __assert_func.
	* include/cygwin/version.h: Bump API minor number.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygwin.patch10
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20070627/94a1c4b7/attachment.ksh>

More information about the Cygwin-patches mailing list