FW: Error from memcpy in cstring

Dingjun Chen Dingjun.Chen@geotechairborne.com
Thu Nov 9 13:41:29 GMT 2023


Hi, Ruoyao, 

Thanks indeed for your advice. After I change 'include_directories' below and then the errors occurred before are gone. 

Thanks again and have a great day, 

Best regards, 

Dingjun


include_directories(
        "/home/Dingjun.Chen/x-tools/HOST-x86_64-pc-cygwin/i686-linux-musl/lib/gcc/i686-linux-musl/13.2.0/include/ssp"
        "${PROJECT_SOURCE_DIR}/include"
        "/home/Dingjun.Chen/usr/include/rtd"
        "/home/Dingjun.Chen/usr/include/gsc"
     )


-----Original Message-----
From: Xi Ruoyao <xry111@xry111.site> 
Sent: Thursday, November 9, 2023 8:19 AM
To: Dingjun Chen <Dingjun.Chen@geotechairborne.com>; LIU Hao <lh_mouse@126.com>; gcc-help@gcc.gnu.org
Subject: Re: FW: Error from memcpy in cstring

External Email Warning: Do not click any links or open any attachments unless you trust the sender and know the content is safe. From Geotech IT.



On Thu, 2023-11-09 at 13:14 +0000, Dingjun Chen wrote:

> include_directories(
>         "/home/Dingjun.Chen/x-tools/HOST-x86_64-pc-cygwin/i686-linux-musl/i686-linux-musl/include/c++/13.2.0"
>         "/home/Dingjun.Chen/x-tools/HOST-x86_64-pc-cygwin/i686-linux-musl/lib/gcc/i686-linux-musl/13.2.0/include/ssp"
>         "/home/Dingjun.Chen/x-tools/HOST-x86_64-pc-cygwin/i686-linux-musl/i686-linux-musl/sysroot/usr/include"
>         "/home/Dingjun.Chen/x-tools/HOST-x86_64-pc-cygwin/i686-linux-musl/i686-linux-musl/sysroot/usr/include/asm"
>         "/home/Dingjun.Chen/x-tools/HOST-x86_64-pc-cygwin/i686-linux-musl/lib/gcc/i686-linux-musl/13.2.0/include/ssp"

All entries above just seem wrong.

/home/Dingjun.Chen/x-tools/HOST-x86_64-pc-cygwin/i686-linux-musl/i686-
linux-musl/include/c++/13.2.0 should be a default system C++ header path.

/home/Dingjun.Chen/x-tools/HOST-x86_64-pc-cygwin/i686-linux-musl/i686-
linux-musl/sysroot/usr/include should be a default system header search paths if --sysroot is used correctly.

The other paths contain internal implementation details, and they should never be used with -I.

In this case /home/Dingjun.Chen/x-tools/HOST-x86_64-pc-cygwin/i686-
linux-musl/lib/gcc/i686-linux-musl/13.2.0/include/ssp contains a string.h, so using it with -I causes #include <string.h> to find a wrong string.h.

--
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University


More information about the Gcc-help mailing list