[csw-users] Unable to compile spawn.h using G++ 4.6.3

Dmitri Shubin sbn at tbricks.com
Wed Apr 25 16:23:38 CEST 2012


Well, looks like they handle this problem in GCC 4.7.0

It has the following in gcc-4.7.0/fixincludes/inclhack.def:

/*
  * Solaris 10+ <spawn.h> uses char *const argv[_RESTRICT_KYWD] in the
  * posix_spawn declarations, which doesn't work with C++.
  */
fix = {
     hackname  = solaris_posix_spawn_restrict;
     files     = spawn.h;
     mach      = '*-*-solaris2*';
     c_fix     = format;
     c_fix_arg = "%1*_RESTRICT_KYWD %2%3";
     select    = "(.*[ \t]+)([a-z]+)\\[_RESTRICT_KYWD\\](.*)";
     test_text =
     "char *const argv[_RESTRICT_KYWD],\n"
     "char *const envp[_RESTRICT_KYWD]);";
};

Probably it could be "backported" to 4.6.3 if there is something that 
prevents 4.7.0 from being imported.


More information about the users mailing list