Did MAMAIgnoreDeprecatedOpen ever work on Linux?


Yury Batrakov
 

Classification: Public
Hi team,

Is MAMAIgnoreDeprecatedOpen supposed to work for Linux with gcc > 4.6?
See the following example:

// Next 3 lines were copied from wombat/.../linux/port.h
_Pragma ("GCC diagnostic push")
_Pragma ("GCC diagnostic ignored \"-Wdeprecated\"")
_Pragma ("GCC diagnostic ignored \"-Wdeprecated-declarations\"")

int __attribute__((deprecated)) b() {
return 0;
}

_Pragma ("GCC diagnostic pop")

int main() {
printf("GCC %d %d\n" , __GNUC__, __GNUC_MINOR__);
b();
return 0;
}

When compiling with 4.8 it shows the following warnings anyway:
/opt/gcc/gcc-4.8.1/bin/g++ -Wall -Wextra 123.c
123.c: In function 'int main()':
123.c:15:9: warning: 'int b()' is deprecated (declared at 123.c:7) [-Wdeprecated-declarations]
b();
^
123.c:15:11: warning: 'int b()' is deprecated (declared at 123.c:7) [-Wdeprecated-declarations]
b();
^

But if we place those pragmas around invocation of b() (not around the definition) all warnings go away


---
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

Please refer to https://www.db.com/disclosures for additional EU corporate and regulatory disclosures and to http://www.db.com/unitedkingdom/content/privacy.htm for information about privacy.

Join Openmama-dev@lists.openmama.org to automatically receive all group messages.