| Summary: | false positive for 'no return in function returning non void' when using pthread_exit() | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Matt Hargett <matt> |
| Component: | cdt-codan | Assignee: | Elena Laskavaia <elaskavaia.cdt> |
| Status: | RESOLVED FIXED | QA Contact: | Elena Laskavaia <elaskavaia.cdt> |
| Severity: | normal | ||
| Priority: | P3 | CC: | cdtdoug, eclipse.sprigogin, yevshif |
| Version: | 8.0 | ||
| Target Milestone: | 8.1.0 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Bug Depends on: | 316076 | ||
| Bug Blocks: | |||
We can special-case pthread_exit, but a real solution to this problem is to fix bug 316076. This bug should be fixed together with bug 316076. Please reopen if it's still not working. |
Build Identifier: 201105160958 CDT correctly infers non-returning when using exit(), but not pthread_exit() for the following code: static void * timer_pthread(void *arg) { Timer_Thread_Args *args = (reinterpret_cast<Timer_Thread_Args*>(arg)); if( args->my_flags == KNL::Timer::PERIODIC ) { for(;;) { KNL::Sleep(args->my_expiry_in_nanoseconds); if( KNL::is_valid_pid(args->my_caller) ) { KNL::Signal(args->my_caller, TIMER_THREAD_TIMER_SIGNAL, true); } } } else { KNL::Sleep(args->my_expiry_in_nanoseconds); if( KNL::is_valid_pid(args->my_caller) ) { KNL::Signal(args->my_caller, TIMER_THREAD_TIMER_SIGNAL, true); } } delete args; pthread_exit(NULL); } Reproducible: Always