Issue Details (XML | Word | Printable)

Key: PCC-446
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Anders Magnusson
Reporter: Gregory McGarry
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
pcc

Side effects of __builtin_unimpl()

Created: 04/Jun/14 10:28 AM   Updated: 06/Jun/14 09:06 AM
Component/s: C frontend
Affects Version/s: None
Fix Version/s: None

Environment: OS X 10.6


 Description  « Hide
For unimplemented builtins, (I think) a local symbol name is allocated and the builtin is mapped to the version in libc.

This causes a problem when there is already a local variable of the same name. For example, the apple headers have the following code which fails to build:

static __inline__ int __inline_isnormalf(float __x )
{
  float fabsf = __builtin_fabsf(__x);
  if( __x != __x ) return 0;
  return fabsf < __builtin_inff() && fabsf >= __FLT_MIN__;
}

(found in /usr/include/architecture/i386/math.h)

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson added a comment - 06/Jun/14 09:06 AM
Declare external function at level 0 to avoid multiple definitions of the same name.