asd1355215911 / mongoose

Automatically exported from code.google.com/p/mongoose
MIT License
0 stars 0 forks source link

void (...) is casted to void *(...) in mg_start #392

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Casting void (...) to void *(...), which mg_start_thread and pthread_create 
accept, is unsafe.

The only reason why compiler doesn't give a warning is, master_thread and 
worker_thread are casted to mg_thread_function_t (which has the correct 
signature) explicitly.

The fix is to change the signatures of master_thread and worker_thread to 
return void*.

A (rather simple) patch is attached.

Original issue reported on code.google.com by pas.n...@gmail.com on 8 Jan 2013 at 2:58

Attachments:

GoogleCodeExporter commented 9 years ago
Submitted 
https://github.com/valenok/mongoose/commit/a8b08c6784aab0cf98eb34ecaec0fe380168d
040

Original comment by valenok on 15 Jan 2013 at 1:25