Hi,

regarding the warning: This seems to be a bug. We have

__data void *
memcpypgm2ram (__data void *dst, __code void *src, size_t acount)
{
  char __data *d = dst;
  char __code *s = src;
  /*
   * copy from lower addresses to higher addresses
   */
  while (acount--)
    *d++ = *s++;
  return dst;
}

src and s should have const qualifiers, no? One might think that _code
should imply const - but if i remember correctly, that was true in most but
not all cases... Maybe we imply a const in the return of your function but
not in the arguments? Strange...

You could try copying the library function to your project and adjust the
arguments (and s) just to see if it helps?

Regarding the second issue: Do you link main.o twice by any chance? Maybe
by compiling main.c once as part of the sources and again to trigger
linking with all .o files including main.o?
Could you post all relevant build output - with verbose enabled to see the
files being linked?
If the error occurs during compilation - could you provide the .asm file?
(sdcc with -S and -o foo.asm could do the trick)?

I'll be unavailable for the next week or so and may not be able to read or
answer mail :-(.

Raphael

Am 21.07.2017 19:57 schrieb "Kustaa Nyholm" <kustaa.nyh...@sparetimelabs.com
>:

I'm runnin sdcc 3.4.0 and targeting PIC18F45K50


I get this warning:

main.c:670: warning 196: pointer target lost const qualifier

from this:

memcpypgm2ram(&hid_tx_buffer.uint8[0],get_toad4_config(),63);

with these defs:

__code void* get_toad4_config();

volatile hid_buffer_t hid_tx_buffer;

this however does not produce any warning:

memcpyram2ram(&hid_tx_buffer.uint8[0], &g_toad4_status.steppers[0],8);

so I'm thinking it is the get_toad4_config() that produces the warning.

I don't get it.

Also slightly related:

I get this:

../obj/main.asm:3683:Error[154]   Each object file section must be
contiguous: ".code"
../obj/main.asm:3683:Error[116]   Address label duplicated or different in
second pass: "_g_toad4_config"
Error[181]   System error while writing object file.

if I have anything like this:

__code int g_toad4_config = {0};


in my main.c but not if I have it in any other source file.


confused, Kusti
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to