freebsd / atf

Libraries to write tests in C, C++ and shell
Other
127 stars 44 forks source link

execute_with_shell() failed on FreeBSD/MIPS with GCC 4.2.1 #26

Closed bukinr closed 5 months ago

bukinr commented 7 years ago

execute_with_shell() failed to convert C++ std::string into C const char* here:

sh_argv[0] = atf::env::get("ATF_SHELL", ATF_SHELL).c_str();

In result we have "ZZZZZZZZ" instead of "/bin/sh". E.g. https://people.freebsd.org/~br/kyua_mips/bin_cat_cat_test_align.html

this workaround helps:

const std::string shell = atf::env::get("ATF_SHELL", ATF_SHELL).c_str();
sh_argv[0] = shell.c_str();

This problem found on FreeBSD/MIPS64EB platform (GCC 4.2.1).

Apteryks commented 5 months ago

True for any architecture, still the case with GCC 11 on x86_64