Commit ac23d22
committed
binder: declare main in global NS, w/o extern "C"
The main function should be in the global namespace, not the android
namespace. We were using 'extern "C"' to prevent the mangling, but the
C++ standard doesn't allow a linkage-specification for main,
https://eel.is/c++draft/basic.start.main#3.sentence-5:
"The main function shall not be declared with a linkage-specification
([dcl.link])."
Clang has started warning on incorrect declarations of main (-Wmain).
Bug: http://b/379133546
Test: m binder_thread_stats libbinderdebug_test binderSafeInterfaceTest
Change-Id: I1c53ce621391b5577c8c04b21117e9b59fe051361 parent 99871bf commit ac23d22
3 files changed
Lines changed: 17 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
858 | 858 | | |
859 | 859 | | |
860 | 860 | | |
861 | | - | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
862 | 868 | | |
863 | 869 | | |
864 | 870 | | |
| |||
875 | 881 | | |
876 | 882 | | |
877 | 883 | | |
878 | | - | |
879 | | - | |
880 | | - | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
| 26 | + | |
26 | 27 | | |
27 | | - | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
64 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
65 | 72 | | |
66 | 73 | | |
67 | 74 | | |
| |||
84 | 91 | | |
85 | 92 | | |
86 | 93 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
| |||
0 commit comments