Re: Segfault generated by gcc-7

2017-08-29 Thread Jonathan Wakely
On 29 August 2017 at 11:38, Marek Polacek wrote: > On Tue, Aug 29, 2017 at 12:31:39PM +0200, Marco Varlese wrote: >> Hi, >> >> I got a SEGFAULT in my program when compiling it with gcc-7 but it >> is/was all good when using gcc-6. >> >> The SEGFAULT happens due to the line below: >> d_point = *p; >

Re: Segfault generated by gcc-7

2017-08-29 Thread Markus Trippelsdorf
On 2017.08.29 at 12:35 +0200, Markus Trippelsdorf wrote: > On 2017.08.29 at 12:31 +0200, Marco Varlese wrote: > > Hi, > > > > I got a SEGFAULT in my program when compiling it with gcc-7 but it > > is/was all good when using gcc-6. > > > > The SEGFAULT happens due to the line below: > > d_point =

Re: Segfault generated by gcc-7

2017-08-29 Thread Marek Polacek
On Tue, Aug 29, 2017 at 12:31:39PM +0200, Marco Varlese wrote: > Hi, > > I got a SEGFAULT in my program when compiling it with gcc-7 but it > is/was all good when using gcc-6. > > The SEGFAULT happens due to the line below: > d_point = *p; > > And a fix for it (with gcc-7) has been: > memcpy(&d_

Re: Segfault generated by gcc-7

2017-08-29 Thread Markus Trippelsdorf
On 2017.08.29 at 12:31 +0200, Marco Varlese wrote: > Hi, > > I got a SEGFAULT in my program when compiling it with gcc-7 but it > is/was all good when using gcc-6. > > The SEGFAULT happens due to the line below: > d_point = *p; > > And a fix for it (with gcc-7) has been: > memcpy(&d_point, >

Segfault generated by gcc-7

2017-08-29 Thread Marco Varlese
Hi, I got a SEGFAULT in my program when compiling it with gcc-7 but it is/was all good when using gcc-6. The SEGFAULT happens due to the line below: d_point = *p; And a fix for it (with gcc-7) has been: memcpy(&d_point, p, sizeof(d_point)); Does this make any sense to anybody?