octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating a Snapshot


From: John W. Eaton
Subject: Re: Creating a Snapshot
Date: Thu, 1 Jun 2006 13:20:01 -0400

On 30-May-2006, William Poetra Yoga Hadisoeseno wrote:

| Uh, this is a problem with gcc 3.4.x I think. The solution (it's in
| the mailing list IIRC) is to use X_CAST there, which is just:
| 
| #define X_CAST(T, E) (T) (E)
| 
| It will generate a warning (old-style cast) but not an error.
| 
| John: Today I got this error (I'm using gcc-3.4.6) (the /root/dev
| thingy is just my habit)
| 
| g++ -c  -fPIC -I. -I/root/dev/octave/octave/src -I.. -I../liboctave
| -I../src -I../libcruft/misc -I/root/dev/octave/octave
| -I/root/dev/octave/octave/liboctave -I/root/dev/octave/octave/src
| -I/root/dev/octave/octave/libcruft/misc  -DHAVE_CONFIG_H -mieee-fp
| -Wall -W -Wshadow -Wold-style-cast -O2
| /root/dev/octave/octave/src/load-path.cc -o pic/load-path.o
| /root/dev/octave/octave/src/load-path.cc: In member function `void
| load_path::do_set(const std::string&)':
| /root/dev/octave/octave/src/load-path.cc:427: error: ISO C++ forbids
| casting between pointer-to-function and pointer-to-object
| make: *** [pic/load-path.o] Error 1
| 
| Since gcc 3.4.x forbids the cast using reinterpret_cast, we can't use
| it here (but gcc 4.? allows it). I propose adding a macro
| "unwind_protect_fptr", which is basically "unwind_protect_ptr" but
| with the old-style cast instead of reinterpret_cast, like this:
| 
| #define unwind_protect_fptr(p) \
|   unwind_protect::save_ptr ((void **) (&(p)), \
|                             (void *) (p))

I think this is a bug in GCC 3.4, not Octave.

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]