Problem with automatic prototype generation in the Arduino IDE

As discussed in the way the automatic prototype generation works causes some issues(

One suggestion for a workaround to implement that was not suggested there but should be fairly easy to do is to check if an exact prototype for the function that was just encountered has already been seen, if not then make one as usual. If it has been seen(because it was already written in the source) then don't generate a prototype. Update the FAQ with a comment about explicitly putting in a prototype if you use custom datatypes in the return type or argument list of a function to maybe fix the issue).

Currently it doesn't seem to matter if you explicitly declare prototypes.

The old thread suggests typecasting void pointers which of course works but it much more ugly and less readable than this solution would be, not to mention the horrors that can come of (beginners) playing with pointers.

A patch that fixes some of the problem at least:

If you use a custom datatype as a return value or argument of a function, put a prototype for the function somewhere between the datatype definition and the function definition, the IDE will assume you know what you're doing and not generate a prototype for the function itself and just leave the one you defined in place.