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

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

RE: [avr-gcc-list] Address of code segment


From: Weddington, Eric
Subject: RE: [avr-gcc-list] Address of code segment
Date: Thu, 28 Jan 2010 07:19:12 -0700

 

> -----Original Message-----
> From: 
> address@hidden 
> [mailto:address@hidden
> org] On Behalf Of Robert von Knobloch
> Sent: Thursday, January 28, 2010 2:53 AM
> To: address@hidden
> Subject: [avr-gcc-list] Address of code segment
> 
> 
> CODESECTION uint16_t test7(void)
> {
>     uint8_t size7prog;
> 
>     // Write assembler program to tester RAM. BEWARE of page size !!
>     for (size7prog = 0; size7prog < (4 * 32); ++size7prog)
>     parms.flashbuf[size7prog] =
> test_pgm_read_byte((PGM_VOID_P)(&test7prog + size7prog)); *****
> //.........
> // Having got the assembler in the ram buffer parms.flashbuf[ 
> ], I have
> existing routines to transfer the code to the target using ISP.
> //........
> }
> 
> CODESECTION void test7prog(void)
> {
>     asm (   "some assembler code \n\t"
>         : : );
> }
> 
> Although working, the starred line gives the warning "passing 
> argument 1
> of 'test_pgm_read_byte' discards qualifiers from pointer target type"
> I had hoped the cast of (PGM_VOID_P) would help, but it doesn't.
> What is the 'right' way (from the compiler's view) to extract the
> address of the assembler code ?
> (I like a clean compile with no warnings).

You don't show us the prototype of test_pgm_read_byte. This is important 
because this is the line that the warning is happening on. So we need all 
information about this function.




reply via email to

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