avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] Multidimensional arrays?


From: E. Weddington
Subject: Re: [avr-gcc-list] Multidimensional arrays?
Date: Wed, 12 Mar 2003 14:11:39 -0700

On 11 Mar 2003 at 15:02, Russell E. Hoffman wrote:

> 
> Hi, this is my first post to the AVR-GCC list.
> 
> My question is: are multidimensional arrays broken in avr-gcc? When I
> compile the following code:
> 
> unsigned char foo[3][4];
> 
> I get the following warning:
> 
> avr-gcc -c -g -Os -funsigned-char -funsigned-bitfields -fpack-struct
> -Wall -Wstrict-prototypes -Wa,-ahlms=rev1.lst -mmcu=atmega8 -I. rev1.c
> -o rev1.o
> 
> avr-gcc -WI,-Map=rev1.map,--cref -mmcu=atmega8 rev1.o -lm --output
> rev1.elf avr-objcopy -O ihex -R .eeprom rev1.elf rev1.hex avr-objcopy
> -j .eeprom --set-section-flags=.eeprom="alloc,load"
> --change-section-lma .eeprom=0 -O ihex rev1.elf rec1.eep avr-objdump
> -h -S rev1.elf >rev1.lss objtool loadelf rev1.elf mapfile rev1.map
> writecof rev1.cof WARNING: - symbol 'foo' could not be resolved to a
> type - using VOID.
> 
> I believe the error is actually from "objtool", not gcc itself. I'm
> using avr-gcc for Windows, and using the stock Makefile from the demo
> code. I use AVR Studio 3.56.

You are correct. The warning follows objtool and is from that 
software.
 
> My question is -- is this a known bug? Will the code still execute
> correctly, even if perhaps the simulator won't trace it properly?

The bug is in objtool. The version of objtool that ships with WinAVR 
is 0.05 beta and is known to be buggy. Your resulting Intel Hex file 
should be just fine. Remember that GCC has been around for over 10 
years and is usually more standards compliant than other cross-
compilers I've seen. So they would definitely have 2D arrays worked 
out by now. :-)

Eric


reply via email to

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