[Top][All Lists]
[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
- [avr-gcc-list] memcpy() : problem when passing destination pointer,
Vincent Trouilliez <=
- Re: [avr-gcc-list] memcpy() : problem when passing destination pointer, Graham Davies, 2009/02/10
- Re: [avr-gcc-list] memcpy() : problem when passing destination pointer, Vincent Trouilliez, 2009/02/10
- Re: [avr-gcc-list] memcpy() : problem when passing destination pointer, Joerg Wunsch, 2009/02/10
- RE: [avr-gcc-list] memcpy() : problem when passing destination pointer, Weddington, Eric, 2009/02/10
- Re: [avr-gcc-list] memcpy() : problem when passing destination pointer, Vincent Trouilliez, 2009/02/11
- Re: [avr-gcc-list] memcpy() : problem when passing destination pointer, Bernard Fouché, 2009/02/11
- RE: [avr-gcc-list] memcpy() : problem when passing destination pointer, Dave Hansen, 2009/02/11