#1097 struct memcpy problem

closed-fixed
5
2013-05-25
2006-04-12
No

#include <pic16c745.h>
#include <stdint.h>
#include <string.h>

struct usb_buffer
{
uint8_t bmRequestType;

uint8_t bRequest;

uint16_t wValue;

uint16_t wIndex;

uint16_t wLength;
};

void usb_token_setup(void)
{
static struct usb_buffer buffer; // Nonstatic doesn't
work in sdcc 2.5.6
void *b = (__data uint8_t *)(BD0OAL + 0x100);

memcpy(&buffer, b, sizeof(buffer));
}

Compiling the above program fragment with
sdcc -mpic14 -p16c745 -c --std-c99
results in a segmentation fault.

sdcc --version gives:
SDCC :
mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08
2.5.6 #1246 (Apr 12 2006) (UNIX)

Discussion

  • Raphael Neider

    Raphael Neider - 2006-04-24
    • milestone: --> fixed
    • assigned_to: nobody --> tecodev
    • status: open --> closed-fixed
     
  • Raphael Neider

    Raphael Neider - 2006-04-24

    Logged In: YES
    user_id=1115835

    This is caused by the bug as #1474602 was, therefore fixed
    in SDCC r4117 as well.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks