I'm now debugging code but need to keep binary compatibility. There now is a modification about the default value of function parameter.
void functionName(const type parameter = class::A::getValue());
Now I want to just change it like this :
void functionName(const type parameter);
Is it still binary compatibility?
Default parameters don't change the type of a function. gcc 4.9.1 compiles this code without warnings:
#include <iostream>
using namespace std;
static void f (int x) {
cout << x << endl ;
}
static void g() ;
int main() {
f (99) ;
g() ;
return 0 ;
}
static void f (int x = 101) ;
static void g() {
f() ;
}
Re-declaring f to take a default parameter value is allowed here, which means that its linkage is unchanged. So you'll be OK.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With