| Anonymous | Login | 2025-12-12 03:02 CST | ![]() |
| My View | View Issues |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
| 0000087 | Rosetta | [All Projects] Crash | public | 2012-08-23 16:57 | 2012-09-20 14:32 | ||||||||
| Reporter | smlewis | ||||||||||||
| Assigned To | smlewis | ||||||||||||
| Priority | normal | Severity | crash | Reproducibility | unable to reproduce | ||||||||
| Status | confirmed | Resolution | open | ||||||||||
| Platform | Fedora 17 with GCC 4.7 | OS | Fedora | OS Version | 17 | ||||||||
| Product Version | 3.4 | ||||||||||||
| Fixed in Version | |||||||||||||
| Summary | 0000087: Compiler error for GCC 4.7: src/protocols/jd2/SingleFileBuffer.cc:148:13: error: 'sleep' was not declared in this scope | ||||||||||||
| Description | http://www.rosettacommons.org/content/keyerror-unknown-version-number-47-compiler-gcc-fedora-17 [^] Appears #include <unistd.h> will fix it, but I'm not sure that's the optimal fix for trunk | ||||||||||||
| Additional Information | Is it worthwhile to mock up a 4.7-specific ifdef in this code? What about just including unistd.h in all cases (does that even work?) I assume from the nomenclature that it's a c header not a C++ standard library header so I'm loath to do that. | ||||||||||||
| Tags | No tags attached. | ||||||||||||
| Application(s) Affected | compilation bug | ||||||||||||
| Command Line Used | compilation bug | ||||||||||||
| Developer Options | |||||||||||||
| Fixed in SVN Version | |||||||||||||
| Attached Files | |||||||||||||
Notes |
|
|
(0000084) smlewis (Administrator) 2012-08-27 09:57 |
#include <unistd.h> allows compilation in this case. I have not changed anything in SVN and am not marking this as fixed until/unless someone with GCC 4.7 can test out possibly-more-appropriate headers. |
|
(0000085) smlewis (Administrator) 2012-08-27 09:58 |
#include <unistd.h> allows compilation in this case. I have not changed anything in SVN and am not marking this as fixed until/unless someone with GCC 4.7 can test out possibly-more-appropriate headers. |
|
(0000107) honda (Developer) 2012-09-20 11:53 |
How about providing a home-made sleep() using the standard C library's nanosleep()? #include <time.h> // sleep for secs seconds. return 0 if completes without interruption. int sleep(int secs) { // time to sleep struct timespec req; req.tv_sec = secs; req.tv_nsec = 0; // remaining time in ns will be saved here if interrupted. // nothing will be saved when NULL. struct timespec * rem = NULL; // return 0 if successful. non-zero otherwise return nanosleep( &req, rem ); } |
|
(0000108) smlewis (Administrator) 2012-09-20 14:32 |
I spoke briefly with Andrew, who agrees that "#include <unistd.h>" is not a viable solution. The bigger question is, what sleep() does SingleFileBuffer think it is calling, is it calling that function in all versions/compilers or is it accidentally miscompiling, and finally why does 4.7 treat it differently than other version? I guess a locally-defined sleep() is a functional solution, but it implies that there really isn't a portable, STL-defined function that does that, which seems strange... |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2012-08-23 16:57 | smlewis | New Issue | |
| 2012-08-27 09:57 | smlewis | Note Added: 0000084 | |
| 2012-08-27 09:58 | smlewis | Note Added: 0000085 | |
| 2012-08-27 09:58 | smlewis | Assigned To | => smlewis |
| 2012-08-27 09:58 | smlewis | Status | new => confirmed |
| 2012-09-20 11:53 | honda | Note Added: 0000107 | |
| 2012-09-20 14:32 | smlewis | Note Added: 0000108 | |
| Copyright © 2000 - 2012 MantisBT Group |