This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Tutorial 5
- From: Mark Butcher <M_J_BUTCHER at compuserve dot com>
- To: gcc <gcc at gcc dot gnu dot org>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Thu, 27 Jun 2002 18:32:49 -0400
- Subject: 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