A function to handle multiple datatypes

pico:

jraskell:
The cases to break type safety are when there are no better options available. This is NOT one of those cases.

I'm sorry, but the approach I suggested to the OP (which was essentially the same as that already provided by Coding Badly), had absolutely nothing to do with templates. It was also perfectly "safe", general, and even elegant, if implemented correctly. It also happens takes up less space in flash, as I think I may have mentioned in passing.

I was not commenting on any code beyond what I quoted in my post. I had no criticisms towards the code posted by Coding Badly because it was quite clear that it relied on void pointers. My actual criticism was made quite clearly in my previous post. Not just once, but twice, so I'm not going to bother reiterating it for a third time.

Second, any usage of void pointer is NOT perfectly "safe". To paraphrase Indigo Montoya, "I do not think that word means what you think it means.". There are acceptable uses of void pointer, even appropriate uses. I never argued that there weren't, though you seem to be under the impression that I have.

My original question still stands to the OP, and to everyone in general even, what types of data are being transmitted that requires the use of void pointer. Without that information, it seems rather shortsighted to me to claim any solution to the problem is the best solution.

pico:
If "type safety" is paramount before all other considerations in writing YOUR code, well, good luck to you.

Where did I state type safety was "paramount before all other considerations"? I don't believe I did. Actually, I'm absolutely positive that I did not.

You may want to work on your reading comprehension. It appears to be a bit lacking.