Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 346557 - false positive for 'no return in function returning non void' when using pthread_exit()
Summary: false positive for 'no return in function returning non void' when using pthr...
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-codan (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 8.1.0   Edit
Assignee: Elena Laskavaia CLA
QA Contact: Elena Laskavaia CLA
URL:
Whiteboard:
Keywords:
Depends on: 316076
Blocks:
  Show dependency tree
 
Reported: 2011-05-19 18:34 EDT by Matt Hargett CLA
Modified: 2012-04-16 23:03 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Hargett CLA 2011-05-19 18:34:40 EDT
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
Comment 1 Sergey Prigogin CLA 2011-05-19 18:48:56 EDT
We can special-case pthread_exit, but a real solution to this problem is to fix bug 316076.
Comment 2 Sergey Prigogin CLA 2012-04-16 23:03:58 EDT
This bug should be fixed together with bug 316076. Please reopen if it's still not working.