> -----Original Message----- > From: > avr-gcc-list-bounces+eric.weddington=atmel....@nongnu.org > [mailto:avr-gcc-list-bounces+eric.weddington=atmel....@nongnu. > org] On Behalf Of Robert von Knobloch > Sent: Thursday, January 28, 2010 2:53 AM > To: avr-gcc-list@nongnu.org > 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. _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list