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

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

[avr-gcc-list] memcpy() : problem when passing destination pointer


From: Vincent Trouilliez
Subject: [avr-gcc-list] memcpy() : problem when passing destination pointer
Date: Tue, 10 Feb 2009 10:17:01 +0100

Morning,

I am trying to copy part of a buffer into another buffer with memcpy():

memcpy(KLineFrameM1, &Buff[2], 66);

... but get a warning about the destination pointer:

ui.c:989: warning: passing argument 1 of ‘memcpy’ discards qualifiers
from pointer target type


KLineFrameM1 is declared and initialised in a different C file, as
extern volatile. I think memcpy must have a problem with this because
when I substituted this buffer with a local one, it didn't complain.

Ideas (other than flaming me, of course ;-) ? 

Here is the code:

kline.h
-------
extern volatile uint8_t KLineFrameM1[65];

***************************************************************
kline.c
-------
#include "kline.h"

volatile uint8_t KLineFrameM1[65] = {0x01, 0x09, ..... };


**************************************************************
ui.c
-----
#include "kline.h"

uint8_t Buff[68];

memcpy(KLineFrameM1, &Buff[2], 66);



Regards,


--
Vince




reply via email to

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