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

Re: [MiNT] wide-char and g++



On 04/19/13 12:55, Alan Hourihane wrote:
On 04/19/13 12:30, Jeffrey Armstrong wrote:
On Thu, 18 Apr 2013, Alan Hourihane wrote:

As a simple solution something like

# if __GNUC__ <= 2
# define __restricted
# endif


Yes, I'd prefer that.

Jeff - is that something you can fix ?

I don't have 2.95 currently installed so can't check.

That's no problem, _but_ are you asking whether the handful of instances that you added to wchar.h should retain the __restrict qualifier? I'm only asking because a very large number of musl functions originally used the __restrict qualifier. Again, I removed them to maintain GCC 2.95 compatibility. We'd then have maybe 5 functions with __restrict even though most of them actually had them originally.

All I'm suggesting is that the library should have __restrict everywhere it's possible or not at all. It seems silly to retain it on a handful of functions. I would personally prefer to see it added, at the very least, back to everything I had originally imported.

I've added them back to the multibyte/ directory and the include/wchar.h,wctype.h files, and the ones in mintlib/. It's probably worthwhile you check against what's there now as I've brought in the latest musl fixes to multibyte/ as well.

I'd rather add additional "fixit" code to support 2.95 rather than see major changes just to support 2.95. Things like #if __GNUC__ <= 2 work well for these types of things, as it makes it obvious what's happening and also makes it easy to merge later musl code.

Actually, I've just seen this in other code......

/* GCC 2.95 and later have "__restrict"; C99 compilers have
   "restrict", and "configure" may have defined "restrict".  */
#ifndef __restrict
# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__))
#  if defined restrict || 199901L <= __STDC_VERSION__
#   define __restrict restrict
#  else
#   define __restrict
#  endif
# endif
#endif

So, Jeff, Are you sure the __restrict problem you had is really this issue ??

Can you post the actual error you have ?

Alan.