This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Tutorial 5


Hi All

Who understands the following code ? (extract from std_cstdlib.h - gcc 3.1)

**********************************
#pragma GCC system_header

#include <bits/c++config.h>
#include <cstlib.h>
#include <stdlib.h>

namespace std 
{
  using ::div_t;   
  using ::ldiv_t;  

.....

  inline long 
  abs(long __i) { return labs(__i); }

  inline ldiv_t
  div(long __i, long __j) { return ldiv(__i, __j); } 
} 
**********************************
When compiling the c++ library source (eh_alloc.cc) there are errors
because div_t and ldiv_l are not declared.

I have read through some documents in the gcc source and tried to find
something in my C++ book but must admit to not becoming much wiser. Since I
don't understand what the code is doing and can't see the relationship
between included files and configuration/target setup I'm a bit stumped.
(Same error when using mcore-elf and arm-elf targets).

So what is the code ? How does the syntax work ? How can it go wrong ? Can
a configuration problem / error lead to a failure ?


Regards

Mark




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