Is it possible to tell the GCC compiler/optimizer to remove constant arguments from the function's argument list? That is, if I define a function:
void send_byte(uint8_t UART_number /**<= This is a parameter, not an argument */ ,char data /**<= This one is a true argument */ ){ switch(UART_number){ case UART_number_0: UDR0=data; break; case UART_number_1: UDR1=data; break; case .... } return; }
and this time in my program I only use UART1:
send_byte(UART_number_1, my_data); ... send_byte(UART_number_1, another_data); ... send_byte(UART_number_1, and_more);
with the same and known at compile time first argument value, can a compiler change the prototype from:
void send_byte(uint8_t , char);
into:
void send_byte(char);
and remove the dead code from inside of send_byte() this time?