This is usually done by simply checking the range of the input argument, so in the case of the Uno the analogRead() function would have something along the lines of ...
I ran the Blink_AnalogRead example on a Arduino Uno and it ran OK. Then I added some code to the loop() function to check the stack space for the idle task. Then I changed configMINIMAL_STACK_SIZE ...