Bug 20665 - Cannot compile program with <signal.h> and C++ when using -std=XXX
Summary: Cannot compile program with <signal.h> and C++ when using -std=XXX
Status: UNCONFIRMED
Alias: None
Product: cygwin
Classification: Unclassified
Component: Cygwin Applications (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Reini Urban
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-04 00:41 UTC by Jeffrey Walton
Modified: 2021-08-24 17:50 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeffrey Walton 2016-10-04 00:41:14 UTC
This is kind of unusual. We recently added a C++ class to help with Unix signals. We are testing under Cygwin i686, which is fairly recent:

$ uname -a
CYGWIN_NT-6.3-WOW asus-windows8 2.6.0(0.304/5/3) 2016-08-31 14:27 i686 Cygwin


Here's the test program:

$ cat ~/test.cxx 
#include <signal.h>

int main(int argc, char* argv[])
{
        struct sigaction new_handler;
        int ret = sigemptyset(&new_handler.sa_mask);
        return 0;
}


Without a -atd=XXX, it results in:

$ g++ -c test.cxx
$


With a -atd=XXX, it results in:

$ g++ -std=c++03 -c test.cxx
test.cxx: In function ?int main(int, char**)?:
test.cxx:6:44: error: ?sigemptyset? was not declared in this scope
  int ret = sigemptyset(&new_handler.sa_mask);
                                            ^
$ g++ -std=c++11 -c test.cxx
test.cxx: In function ?int main(int, char**)?:
test.cxx:6:44: error: ?sigemptyset? was not declared in this scope
  int ret = sigemptyset(&new_handler.sa_mask);
                                            ^
$ g++ -std=c++14 -c test.cxx
test.cxx: In function ?int main(int, char**)?:
test.cxx:6:44: error: ?sigemptyset? was not declared in this scope
  int ret = sigemptyset(&new_handler.sa_mask);
                                            ^
$ g++ -std=c++17 -c test.cxx
test.cxx: In function ?int main(int, char**)?:
test.cxx:6:44: error: ?sigemptyset? was not declared in this scope
  int ret = sigemptyset(&new_handler.sa_mask);




$ g++ -std=gnu++03 -c test.cxx
test.cxx:13:1: error: stray ?\221? in program
 test.cxx: In function ?int main(int, char**)?:
 ^
test.cxx:13:1: error: stray ?\222? in program
test.cxx:14:1: error: stray ?\221? in program
 test.cxx:6:44: error: ?sigemptyset? was not declared in this scope
 ^
test.cxx:14:1: error: stray ?\222? in program
test.cxx:18:1: error: stray ?\221? in program
 test.cxx: In function ?int main(int, char**)?:
 ^
test.cxx:18:1: error: stray ?\222? in program
test.cxx:19:1: error: stray ?\221? in program
 test.cxx:6:44: error: ?sigemptyset? was not declared in this scope
 ^
test.cxx:19:1: error: stray ?\222? in program
test.cxx:23:1: error: stray ?\221? in program
 test.cxx: In function ?int main(int, char**)?:
 ^
test.cxx:23:1: error: stray ?\222? in program
test.cxx:24:1: error: stray ?\221? in program
 test.cxx:6:44: error: ?sigemptyset? was not declared in this scope
 ^
test.cxx:24:1: error: stray ?\222? in program
test.cxx:28:1: error: stray ?\221? in program
 test.cxx: In function ?int main(int, char**)?:
 ^
test.cxx:28:1: error: stray ?\222? in program
test.cxx:29:1: error: stray ?\221? in program
 test.cxx:6:44: error: ?sigemptyset? was not declared in this scope
 ^
test.cxx:29:1: error: stray ?\222? in program
test.cxx:10:1: error: ?$? does not name a type


test.cxx:16:45: error: expected unqualified-id before ?^? token
                                             ^
                                             ^
test.cxx:21:45: error: expected unqualified-id before ?^? token
                                             ^
                                             ^
test.cxx:26:45: error: expected unqualified-id before ?^? token
                                             ^
                                             ^
test.cxx:31:45: error: expected unqualified-id before ?^? token
                                             ^
                                             ^




$ g++ -std=gnu++11 -c test.cxx
test.cxx:13:1: error: stray ?\221? in program
 test.cxx: In function ?int main(int, char**)?:
 ^
test.cxx:13:1: error: stray ?\222? in program
test.cxx:14:1: error: stray ?\221? in program
 test.cxx:6:44: error: ?sigemptyset? was not declared in this scope
 ^
test.cxx:14:1: error: stray ?\222? in program
test.cxx:18:1: error: stray ?\221? in program
 test.cxx: In function ?int main(int, char**)?:
 ^
test.cxx:18:1: error: stray ?\222? in program
test.cxx:19:1: error: stray ?\221? in program
 test.cxx:6:44: error: ?sigemptyset? was not declared in this scope
 ^
test.cxx:19:1: error: stray ?\222? in program
test.cxx:23:1: error: stray ?\221? in program
 test.cxx: In function ?int main(int, char**)?:
 ^
test.cxx:23:1: error: stray ?\222? in program
test.cxx:24:1: error: stray ?\221? in program
 test.cxx:6:44: error: ?sigemptyset? was not declared in this scope
 ^
test.cxx:24:1: error: stray ?\222? in program
test.cxx:28:1: error: stray ?\221? in program
 test.cxx: In function ?int main(int, char**)?:
 ^
test.cxx:28:1: error: stray ?\222? in program
test.cxx:29:1: error: stray ?\221? in program
 test.cxx:6:44: error: ?sigemptyset? was not declared in this scope
 ^
test.cxx:29:1: error: stray ?\222? in program
test.cxx:10:1: error: ?$? does not name a type
 $ g++ -c test.cxx
 ^
test.cxx:16:45: error: expected unqualified-id before ?^? token
                                             ^
                                             ^
test.cxx:21:45: error: expected unqualified-id before ?^? token
                                             ^
                                             ^
test.cxx:26:45: error: expected unqualified-id before ?^? token
                                             ^
                                             ^
test.cxx:31:45: error: expected unqualified-id before ?^? token
                                             ^
                                             ^
Comment 1 ryan9999 2021-08-24 17:50:51 UTC
Look at the best web site here https://freerobuxtips.com for need you all time getting how to get robux for free tips online.