#1292 Initialized struct causes SIGSEGV on pic14

closed-fixed
nobody
5
2013-05-25
2007-02-14
Lou Cyphre
No

Compiling the following code with SDCC 2.6.4, targeting pic14, causes SIGSEGV

------ file: foo.c ------------------------------
#include <stdint.h>

struct sMyStruct {
uint8_t byte0;
uint8_t byte_array[2];
};

struct sMyStruct my_struct = {
0,
{ 0, 0 }
};
-------------------------------------------------

Invoking the compiler produces the result:

$ sdcc -mpic14 -p16f876 -S foo.c
Caught signal 11: SIGSEGV

Seems to happen only with pic14 target, while it doesn't with version 2.6.0, nor with different targets.
Removing the structure element 'byte0' the flaw disappears.

The test gives exactly the same results with the following build/execution environment:
- SDCC built with MS/Visual C 6.0, running on Win32
- SDCC cross-compiled with MingW32 (gcc 3.4.4), running on Win32
- SDCC compiled with GCC 4.0.3, running on Ubuntu Linux 6.06

Discussion

  • Raphael Neider

    Raphael Neider - 2007-02-18

    Logged In: YES
    user_id=1115835
    Originator: NO

    Actually, the array was causing the problems. Fixed in r4638.

    Regards,
    Raphael

     
  • Raphael Neider

    Raphael Neider - 2007-02-18
    • labels: --> pic14 target
    • milestone: --> fixed
    • status: open --> closed-fixed
     

Log in to post a comment.

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

Sign up for the SourceForge newsletter:





No, thanks