void pointers pose certain problems and are usually used to get around the compiler complaining about a missing type specifier for a pointer. If you want to write a "generic" function that returns a pointer, you can do something like this:
void setup() {
//Initialize serial and wait for port to open:
Serial.begin(115200);
}
void *myGeneric() {
// Do something
}
void loop() {
int *ptr;
long *lPtr;
ptr = (int *) myGeneric();
lPtr = (long *) myGeneric();
}
The casts on the return value is required so that the scalar associated with the data type of the pointer is known.