#12422: CFBundle.h on OS X uses __attribute__((format_arg)) improperly
------------------------+---------------------------------------------------
   Reporter:  jdemeyer  |          Owner:  tbd     
       Type:  defect    |         Status:  new     
   Priority:  major     |      Milestone:  sage-5.0
  Component:  packages  |       Keywords:          
Work_issues:            |       Upstream:  N/A     
   Reviewer:            |         Author:          
     Merged:            |   Dependencies:          
------------------------+---------------------------------------------------
Description changed by jdemeyer:

Old description:

> From
> `/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h`
> on `bsd` (and presumably other OS X systems):
> {{{
> #if defined(__GNUC__) && (__GNUC__*10+__GNUC_MINOR__ >= 42) &&
> !defined(__INTEL_COMPILER) && (TARGET_OS_MAC || TARGET_OS_EMBEDDED)
> #define CF_FORMAT_FUNCTION(F,A) __attribute__((format(CFString, F, A)))
> #define CF_FORMAT_ARGUMENT(A) __attribute__((format_arg(A)))
> #else
> #define CF_FORMAT_FUNCTION(F,A)
> #define CF_FORMAT_ARGUMENT(A)
> #endif
> }}}
>
> Later on, Apple is using this in an improper way.  From
> `/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBundle.h`:
> {{{
> CF_EXPORT
> CFStringRef CFBundleCopyLocalizedString(CFBundleRef bundle, CFStringRef
> key, CFStringRef value, CFStringRef tableName) CF_FORMAT_ARGUMENT(2);
> }}}
>
> The problem here is that some versions of GCC do not recognize
> "CFStringRef" as a string type (IMHO GCC is right, this isn't a string
> type).  Disabling the "format_arg()" attribute with `'-Dformat_arg(x)='`
> works.
>
> '''spkg''':
> [http://boxen.math.washington.edu/home/jdemeyer/spkg/python-2.7.2.p2.spkg]

New description:

 From
 `/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h`
 on `bsd` (and presumably other OS X systems):
 {{{
 #if defined(__GNUC__) && (__GNUC__*10+__GNUC_MINOR__ >= 42) &&
 !defined(__INTEL_COMPILER) && (TARGET_OS_MAC || TARGET_OS_EMBEDDED)
 #define CF_FORMAT_FUNCTION(F,A) __attribute__((format(CFString, F, A)))
 #define CF_FORMAT_ARGUMENT(A) __attribute__((format_arg(A)))
 #else
 #define CF_FORMAT_FUNCTION(F,A)
 #define CF_FORMAT_ARGUMENT(A)
 #endif
 }}}

 Later on, Apple is using this in an improper way.  From
 `/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBundle.h`:
 {{{
 CF_EXPORT
 CFStringRef CFBundleCopyLocalizedString(CFBundleRef bundle, CFStringRef
 key, CFStringRef value, CFStringRef tableName) CF_FORMAT_ARGUMENT(2);
 }}}

 The problem here is that some versions of GCC do not recognize
 "CFStringRef" as a string type (IMHO GCC is right, this isn't a string
 type).  Disabling the "format_arg()" attribute with `'-Dformat_arg(x)='`
 works.

 This causes failures for Python and R.

 '''spkg''':
  1.
 [http://boxen.math.washington.edu/home/jdemeyer/spkg/python-2.7.2.p2.spkg]
  2. [http://boxen.math.washington.edu/home/jdemeyer/spkg/r-2.14.0.p3.spkg]

--

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12422#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to