With 24 bits ADC readings overflow can occurs in adc_raw_to_millivolts as the internal calculation is done on a 32 bits integer.
This is fixed by using a 64 bits integer but this also requires adc_gain_invert to take a int64_t* instead of an int32t* a it's second argument, therefore slightly changing the adc API.
What are your thoughts on this ?