This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


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

Re: [Fwd: [Fwd: gdb 20000413 compile problem and strange SEGVproblem]]


In regard to: Re: [Fwd: [Fwd: gdb 20000413 compile problem and strange...:

>> >I've just checked and GDB-5.0 build on an ``OSF1 V4.0 464 alpha'' using
>> >both GCC and the native CC.  I'll assume that these were compiler
>> >warnings rather than fatal compiler errors.  Consequently the cleanups
>> >should get merged into the trunk but not the GDB-5.0 branch.
>> >> Andrew-
>> 
>> Thanks for looking into this.
>> 
>> They were errors, not warnings.  The build stopped at that point.  This was
>> with the latest version of the vendor compiler on alpha-dec-osf4.0f (4.0f ==
>> Rev 1229, you can tell what the letter version is by running `sizer -v').
>> I don't know if I tried this on my 5.0 box at home, but I don't think so.
>> I think rev 464 is osf4.0b, which has a compiler that may not be as recent
>> as the current patched compiler on the later versions of the OS.
>
>Is there a way of convincing the compiler that it shouldn't be so pig
>headed?

I don't think so.  I just checked with both ANSI (-std1) and ANSI+extensions
(-std) and in both cases the 4.0f compiler still objects to the comparisons.

I've been known to be wrong, but my feeling is that the compiler is actually
correct.  Based on my reading of K&R 2e (section 5.4, page 103, last paragraph
which begins "The valid pointer operations are..."), casting `tcomplain' to
`void *' is not enough to allow pointer comparison.

The compiler is being rather pedantic, I'll agree.  However, I just tried
on sparc-sun-solaris2.6 with the SparcWorks 5.0 compiler, and although it
didn't treat it as an error, it did warn about it (and other stuff, most
of which was unsigned vs. signed type mismatches but a couple warnings might
be worth a look later):

"target.c", line 3066: warning: operands have incompatible pointer types: op "=="
"target.c", line 3068: warning: operands have incompatible pointer types: op "=="

I also tried on hppa1.1-hp-hpux10.20 with the vendor ANSI compiler, and it
too warned:

cc: "target.c", line 3066: warning 605: Illegal pointer combination for ==.
cc: "target.c", line 3068: warning 605: Illegal pointer combination for ==.

The AIX 4.x compiler agrees (again, just a warning though):

"target.c", line 3066.31: 1506-068 (W) Operation between types "void(*)(unsigned char*,struct ui_file*)" and "void*" is not allowed.
"target.c", line 3068.36: 1506-068 (W) Operation between types "void(*)(unsigned char*,struct ui_file*)" and "void*" is not allowed.

In fact, gcc and the (normally quite picky) IRIX compiler are the only two
I've been able to find that *don't* consider this worth at least a warning.

Is there a reason why changing the cast as I mentioned in my original
message is unacceptable?

>> If you want to email me how I can get access to the 5.0 tree, I'll happily
>> test the build on a few different versions of the OS, including my 5.x box
>> at home.  If I just do a `cvs checkout' will I get the 5.0 tree, or do I have
>> to do something special?
>
>You would need to specify ``-r gdb_5_0-2000-04-10-branch''.

Thanks, I got all 67 Meg of gdb+dejagnu :-), but decided to try the
gdb-4.95.0 snapshot instead, and the problem still exists in that snapshot.
Trying to build that on 4.0f fails in target.c.

Tim
-- 
Tim Mooney                              mooney@dogbert.cc.ndsu.NoDak.edu
Information Technology Services         (701) 231-1076 (Voice)
Room 242-J1, IACC Building              (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164


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