[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
arrow expression and array of struct
From: |
Ilya Beylin |
Subject: |
arrow expression and array of struct |
Date: |
Wed, 27 Jun 2001 08:34:42 +0200 |
In gdb 5.0, the C expression a->f does not behave well when a is an array.
For instance, in the following example it does have a value but not type:
zeus: ~/test> cat >array1.c
struct { int f,g;} a[1] = {{1,2}};
int main() { return a->f; }
zeus: ~/test> gcc -g array1.c
zeus: ~/test> gdb a.out
GNU gdb 5.0rh-5 Red Hat Linux 7.1
Copyright 2001 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
(gdb) print a->f
$1 = 1
(gdb) ptype a->f
Type struct {...} [1] is not a structure or union type.
Best regards,
--
address@hidden Stockholm Sweden +46-8-6176818 www.prover.com
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- arrow expression and array of struct,
Ilya Beylin <=