This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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: math.h compile error (gcc-2.95.3 + newlib-1.11.0)


Dan Kegel wrote:

Toralf Lund wrote:

I'm now actually down to one error message for my port to gcc cross compiler ;-) In the C code, that is; some of the assembler still needs to be changed.

Anyhow, I get:

In file included from track.c:44:
/usr/lib/gcc-lib/m68k-coff/2.95.3/../../../../m68k-coff/include/math.h:26: syntax error before `union'


extern __IMPORT const union __dmath __infinity[];


Can you whittle this down to a minimal test case, then post the preprocessed
source? Maybe __IMPORT is expanding to something broken...

I get the same problem with a file tst_math.c only containing '#include <math.h>':


% m68k-coff-gcc -traditional -fno-builtin -m68000 -c -o tst_math.o tst_math.c
In file included from tst_math.c:1:
/usr/lib/gcc-lib/m68k-coff/2.95.3/../../../../m68k-coff/include/math.h:26: syntax error before `union'
/usr/lib/gcc-lib/m68k-coff/2.95.3/../../../../m68k-coff/include/math.h:26: warning: array `__infinity' assumed to have one element


The C file and the output from
m68k-coff-gcc -traditional -fno-builtin -m68000 -E -P -o tst_math.i tst_math.c


are included.

Actually, "-traditional" seems to be the problem. I'm wondering if I can make do without it (my code is not ANSI compliant.)

- Toralf

#include <math.h>























































































































































































































































































































typedef long _off_t;
__extension__ typedef long long _off64_t;


typedef int _ssize_t;








































































typedef unsigned int wint_t;























typedef struct
{
  int __count;
  union
  {
    wint_t __wch;
    unsigned char __wchb[4];
  } __value;		
} _mbstate_t;

typedef int _flock_t;







typedef unsigned long __ULong;












struct _Bigint 
{
  struct _Bigint *_next;
  int _k, _maxwds, _sign, _wds;
  __ULong _x[1];
};


struct __tm
{
  int   __tm_sec;
  int   __tm_min;
  int   __tm_hour;
  int   __tm_mday;
  int   __tm_mon;
  int   __tm_year;
  int   __tm_wday;
  int   __tm_yday;
  int   __tm_isdst;
};








struct _atexit {
	struct	_atexit *_next;			
	int	_ind;				
	void	(*_fns[32])(void);	
	void	*_fnargs[32];	        
	__ULong _fntypes;           	        
};









struct __sbuf {
	unsigned char *_base;
	int	_size;
};






typedef long _fpos_t;		
				
































struct __sFILE {
  unsigned char *_p;	
  int	_r;		
  int	_w;		
  short	_flags;		
  short	_file;		
  struct __sbuf _bf;	
  int	_lbfsize;	



  
  char *	_cookie;	

  int (*_read)();
  int (*_write)();
  _fpos_t (*_seek)();
  int	(*_close)();

  
  struct __sbuf _ub;	
  unsigned char *_up;	
  int	_ur;		

  
  unsigned char _ubuf[3];	
  unsigned char _nbuf[1];	

  
  struct __sbuf _lb;	

  
  int	_blksize;	
  int	_offset;	


  struct _reent *_data;	



  _flock_t _lock;	

};


typedef struct __sFILE   __FILE;


struct _glue 
{
  struct _glue *_next;
  int _niobs;
  __FILE *_iobs;
};






















struct _rand48 {
  unsigned short _seed[3];
  unsigned short _mult[3];
  unsigned short _add;

};
















struct _reent
{
  int _errno;			

  


  __FILE *_stdin, *_stdout, *_stderr;

  int  _inc;			
  char _emergency[25];
 
  int _current_category;	
   char *_current_locale;

  int __sdidinit;		

  void (*__cleanup)();

  
  struct _Bigint *_result;
  int _result_k;
  struct _Bigint *_p5s;
  struct _Bigint **_freelist;

  
  int _cvtlen;			
  char *_cvtbuf;

  union
    {
      struct
        {
          unsigned int _unused_rand;
          char * _strtok_last;
          char _asctime_buf[26];
          struct __tm _localtime_buf;
          int _gamma_signgam;
          __extension__ unsigned long long _rand_next;
          struct _rand48 _r48;
          _mbstate_t _mblen_state;
          _mbstate_t _mbtowc_state;
          _mbstate_t _wctomb_state;
          char _l64a_buf[8];
          char _signal_buf[24];
          int _getdate_err;  
          _mbstate_t _mbrlen_state;
          _mbstate_t _mbrtowc_state;
          _mbstate_t _mbsrtowcs_state;
          _mbstate_t _wcrtomb_state;
          _mbstate_t _wcsrtombs_state;
        } _reent;
  

 
      struct
        {

          unsigned char * _nextf[30];
          unsigned int _nmalloc[30];
        } _unused;
    } _new;

  
  struct _atexit *_atexit;	
  struct _atexit _atexit0;	

  
  void (**(_sig_func))(int);

  


  struct _glue __sglue;		
  __FILE __sf[3];  		
};



















































extern struct _reent *_impure_ptr ;

void _reclaim_reent ();
























union __dmath
{
  __ULong i[2];
  double d;
};




extern  const union __dmath __infinity[];








extern double atan ();
extern double cos ();
extern double sin ();
extern double tan ();
extern double tanh ();
extern double frexp ();
extern double modf ();
extern double ceil ();
extern double fabs ();
extern double floor ();






extern double acos ();
extern double asin ();
extern double atan2 ();
extern double cosh ();
extern double sinh ();
extern double exp ();
extern double ldexp ();
extern double log ();
extern double log10 ();
extern double pow ();
extern double sqrt ();
extern double fmod ();









typedef float float_t;
typedef double double_t;








extern int __fpclassifyf (float x);
extern int __fpclassifyd (double x);

















extern double infinity ();
extern double nan ();
extern int isnan ();
extern int isinf ();
extern int finite ();
extern double copysign ();
extern int ilogb ();

extern double asinh ();
extern double cbrt ();
extern double nextafter ();
extern double rint ();
extern double scalbn ();

extern double exp2 ();
extern double scalbln ();
extern double tgamma ();
extern double nearbyint ();
extern long int lrint ();
extern double round ();
extern long int lround ();
extern double trunc ();
extern double remquo ();
extern double copysign ();
extern double fdim ();
extern double fmax ();
extern double fmin ();
extern double fma ();
extern void sincos ();


extern double log1p ();
extern double expm1 ();



extern double acosh ();
extern double atanh ();
extern double remainder ();
extern double gamma ();
extern double gamma_r ();
extern double lgamma ();
extern double lgamma_r ();
extern double erf ();
extern double erfc ();
extern double y0 ();
extern double y1 ();
extern double yn ();
extern double j0 ();
extern double j1 ();
extern double jn ();



extern double hypot ();


extern double cabs();
extern double drem ();









extern float atanf ();
extern float cosf ();
extern float sinf ();
extern float tanf ();
extern float tanhf ();
extern float frexpf ();
extern float modff ();
extern float ceilf ();
extern float fabsf ();
extern float floorf ();


extern float acosf ();
extern float asinf ();
extern float atan2f ();
extern float coshf ();
extern float sinhf ();
extern float expf ();
extern float ldexpf ();
extern float logf ();
extern float log10f ();
extern float powf ();
extern float sqrtf ();
extern float fmodf ();








extern float exp2f ();
extern float scalblnf ();
extern float tgammaf ();
extern float nearbyintf ();
extern long int lrintf ();
extern float roundf ();
extern long int lroundf ();
extern float truncf ();
extern float remquof ();
extern float copysignf ();
extern float fdimf ();
extern float fmaxf ();
extern float fminf ();
extern float fmaf ();

extern float infinityf ();
extern float nanf ();
extern int isnanf ();
extern int isinff ();
extern int finitef ();
extern float copysignf ();
extern int ilogbf ();

extern float asinhf ();
extern float cbrtf ();
extern float nextafterf ();
extern float rintf ();
extern float scalbnf ();
extern float log1pf ();
extern float expm1f ();
extern void sincosf ();


extern float acoshf ();
extern float atanhf ();
extern float remainderf ();
extern float gammaf ();
extern float gammaf_r ();
extern float lgammaf ();
extern float lgammaf_r ();
extern float erff ();
extern float erfcf ();
extern float y0f ();
extern float y1f ();
extern float ynf ();
extern float j0f ();
extern float j1f ();
extern float jnf ();

extern float hypotf ();

extern float cabsf();
extern float dremf ();






extern int *__signgam ();







struct exception 

{
  int type;
  char *name;
  double arg1;
  double arg2;
  double retval;
  int err;
};


extern int matherr ();








































enum __fdlibm_version
{
  __fdlibm_ieee = -1,
  __fdlibm_svid,
  __fdlibm_xopen,
  __fdlibm_posix
};




extern   enum __fdlibm_version __fdlib_version;















------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com

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