| Anonymous | Login | Signup for a new account | 2013-05-23 15:22 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | |||
| 0004129 | OCaml | OCaml general | public | 2006-10-04 20:41 | 2006-11-17 16:40 | |||
| Reporter | oandrieu | |||||||
| Assigned To | doligez | |||||||
| Priority | normal | Severity | minor | Reproducibility | always | |||
| Status | closed | Resolution | fixed | |||||
| Platform | OS | OS Version | ||||||
| Product Version | 3.09.3 | |||||||
| Target Version | Fixed in Version | 3.09.4+dev / +rc | ||||||
| Summary | 0004129: new definition of CAMLreturn produces warnings | |||||||
| Description | The new definition of CAMLreturn in 3.09.3 (cf. bug 0004068) assumes that the returned values is of type value. When CAMLreturn is used in a function that returns a pointer type, the C compiler emits an annoying warning: ,---- | warning: initialization makes integer from pointer without a cast | warning: return makes pointer from integer without a cast `---- | |||||||
| Tags | No tags attached. | |||||||
| Attached Files | ||||||||
Notes |
|
|
(0003841) doligez (manager) 2006-11-15 16:13 |
If anyone has ideas for dealing with this, I want to hear them. |
|
(0003844) oandrieu (reporter) 2006-11-16 10:20 |
- gcc has a typeof construct http://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/Typeof.html#Typeof [^] , so we could define CAMLreturn as: ,---- | #define CAMLreturn(result) do{ \ | typeof (result) caml__temp_result = (result); \ | caml_local_roots = caml__frame; \ | return (caml__temp_result); \ | }while(0) `---- But we need something that works for all compilers. - How about adding a type argument to the macro ? ,---- | #define CAMLreturnT(T, result) do{ \ | T caml__temp_result = (result); \ | caml_local_roots = caml__frame; \ | return (caml__temp_result); \ | }while(0) | | #define CAMLreturn(result) CAMLreturnT(value, result) `---- |
|
(0003847) doligez (manager) 2006-11-17 15:36 edited on: 2006-11-17 16:39 |
I've implemented your second suggestion in 3.09 branch. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2006-10-04 20:41 | oandrieu | New Issue | |
| 2006-11-15 16:13 | doligez | Note Added: 0003841 | |
| 2006-11-15 16:13 | doligez | Assigned To | => doligez |
| 2006-11-15 16:13 | doligez | Status | new => acknowledged |
| 2006-11-16 10:20 | oandrieu | Note Added: 0003844 | |
| 2006-11-17 15:36 | doligez | Note Added: 0003847 | |
| 2006-11-17 16:39 | doligez | Note Edited: 0003847 | |
| 2006-11-17 16:40 | doligez | Status | acknowledged => closed |
| 2006-11-17 16:40 | doligez | Resolution | open => fixed |
| 2006-11-17 16:40 | doligez | Fixed in Version | => 3.09.4+dev / +rc |
| Copyright © 2000 - 2011 MantisBT Group |