g++ does not ignore “deprecated-declaration” + “Werror” error when using “-Wno-deprecated”
The same case from the strikethrough case down here. I have a deprecated function call, and it gives an error. I want to ignore it for now. I can use #undef
but I prefer using a "-Wno-deprecated"
compilation flag, but for some reason I stil get the same error.
I have two modules with calls to the depracted functoin:
SSH_DEPRECATED LIBSSH_API int ssh_get_pubkey_hash(ssh_session session, unsigned char **hash);
// SSH_DEPRECATED == __attribute__ ((deprecated))
// as can be seen from:
// #define SSH_DEPRECATED __attribute__ ((deprecated))
Module A (the errornous module) ouputs a "is depracted" warning made error. I assumed the reason I saw only one error was because the compilation flags of A included -Werror
. However, both of the modules include the same flag.
However, module B has something different. A includes libssh.h
from arm-buidroot-linux-gnueabi
where B includes that libssh.h
and another copy of libssh.h
(I assume the 2nd copy is a copy-paste of an older version of libssh.h
).
I assumed that the SSH_DEPRECATED
does not appear on the 2nd libssh.h
, but I was wrong, so now I'm not what could be the reason.
Currently I got it to work by removing the -Werror
in A, but this is bad since:
- I don't know what is the root cause (i.e. how come it works in B)
- I do want that flag [
-Werror
] (this can be solved by adding-Wno-deprecated
and then returning the
-Werror
, but I don't think of it as a good solution. More like a hack)
My question: What in A can cause this deprecated warning that does not apply in B?
Using powerpc-linux-gnu-g++ (Sourcery G++ Lite 4.3-74) 4.3.2
Note: I know that deprecated Indicates that the name or entity declared with this attribute is deprecated, that is, the use is allowed, but discouraged for some reason.
c++ compiler-errors g++ deprecated
|
show 7 more comments
The same case from the strikethrough case down here. I have a deprecated function call, and it gives an error. I want to ignore it for now. I can use #undef
but I prefer using a "-Wno-deprecated"
compilation flag, but for some reason I stil get the same error.
I have two modules with calls to the depracted functoin:
SSH_DEPRECATED LIBSSH_API int ssh_get_pubkey_hash(ssh_session session, unsigned char **hash);
// SSH_DEPRECATED == __attribute__ ((deprecated))
// as can be seen from:
// #define SSH_DEPRECATED __attribute__ ((deprecated))
Module A (the errornous module) ouputs a "is depracted" warning made error. I assumed the reason I saw only one error was because the compilation flags of A included -Werror
. However, both of the modules include the same flag.
However, module B has something different. A includes libssh.h
from arm-buidroot-linux-gnueabi
where B includes that libssh.h
and another copy of libssh.h
(I assume the 2nd copy is a copy-paste of an older version of libssh.h
).
I assumed that the SSH_DEPRECATED
does not appear on the 2nd libssh.h
, but I was wrong, so now I'm not what could be the reason.
Currently I got it to work by removing the -Werror
in A, but this is bad since:
- I don't know what is the root cause (i.e. how come it works in B)
- I do want that flag [
-Werror
] (this can be solved by adding-Wno-deprecated
and then returning the
-Werror
, but I don't think of it as a good solution. More like a hack)
My question: What in A can cause this deprecated warning that does not apply in B?
Using powerpc-linux-gnu-g++ (Sourcery G++ Lite 4.3-74) 4.3.2
Note: I know that deprecated Indicates that the name or entity declared with this attribute is deprecated, that is, the use is allowed, but discouraged for some reason.
c++ compiler-errors g++ deprecated
could be many things. eg in gcc you can silence warnings when a header is included via-isystem
– user463035818
Nov 14 '18 at 13:44
1
This is not a solution, this is one of many things that could make the warning not to appear inB
. We cannot guess. At this point, this is just opinions you're asking.
– YSC
Nov 14 '18 at 13:47
1
the symptom is that a warning is surpressed, what is the cause i have no clue ;)
– user463035818
Nov 14 '18 at 13:48
2
Just so I understood: You have two compilation units in individual compiler invocations, using identicallibssh.h
(except for path) and identical compiler options, both using the deprecated function, but only one giving the warning? In that case the exact compiler command line and MCVEs of the two compilation units would be helpful.
– user10605163
Nov 14 '18 at 13:49
1
If you expect your post to be read by actual people, then I suggest you don't do something ghastly like striking through the whole of the text you still refer too!
– StoryTeller
Nov 14 '18 at 14:23
|
show 7 more comments
The same case from the strikethrough case down here. I have a deprecated function call, and it gives an error. I want to ignore it for now. I can use #undef
but I prefer using a "-Wno-deprecated"
compilation flag, but for some reason I stil get the same error.
I have two modules with calls to the depracted functoin:
SSH_DEPRECATED LIBSSH_API int ssh_get_pubkey_hash(ssh_session session, unsigned char **hash);
// SSH_DEPRECATED == __attribute__ ((deprecated))
// as can be seen from:
// #define SSH_DEPRECATED __attribute__ ((deprecated))
Module A (the errornous module) ouputs a "is depracted" warning made error. I assumed the reason I saw only one error was because the compilation flags of A included -Werror
. However, both of the modules include the same flag.
However, module B has something different. A includes libssh.h
from arm-buidroot-linux-gnueabi
where B includes that libssh.h
and another copy of libssh.h
(I assume the 2nd copy is a copy-paste of an older version of libssh.h
).
I assumed that the SSH_DEPRECATED
does not appear on the 2nd libssh.h
, but I was wrong, so now I'm not what could be the reason.
Currently I got it to work by removing the -Werror
in A, but this is bad since:
- I don't know what is the root cause (i.e. how come it works in B)
- I do want that flag [
-Werror
] (this can be solved by adding-Wno-deprecated
and then returning the
-Werror
, but I don't think of it as a good solution. More like a hack)
My question: What in A can cause this deprecated warning that does not apply in B?
Using powerpc-linux-gnu-g++ (Sourcery G++ Lite 4.3-74) 4.3.2
Note: I know that deprecated Indicates that the name or entity declared with this attribute is deprecated, that is, the use is allowed, but discouraged for some reason.
c++ compiler-errors g++ deprecated
The same case from the strikethrough case down here. I have a deprecated function call, and it gives an error. I want to ignore it for now. I can use #undef
but I prefer using a "-Wno-deprecated"
compilation flag, but for some reason I stil get the same error.
I have two modules with calls to the depracted functoin:
SSH_DEPRECATED LIBSSH_API int ssh_get_pubkey_hash(ssh_session session, unsigned char **hash);
// SSH_DEPRECATED == __attribute__ ((deprecated))
// as can be seen from:
// #define SSH_DEPRECATED __attribute__ ((deprecated))
Module A (the errornous module) ouputs a "is depracted" warning made error. I assumed the reason I saw only one error was because the compilation flags of A included -Werror
. However, both of the modules include the same flag.
However, module B has something different. A includes libssh.h
from arm-buidroot-linux-gnueabi
where B includes that libssh.h
and another copy of libssh.h
(I assume the 2nd copy is a copy-paste of an older version of libssh.h
).
I assumed that the SSH_DEPRECATED
does not appear on the 2nd libssh.h
, but I was wrong, so now I'm not what could be the reason.
Currently I got it to work by removing the -Werror
in A, but this is bad since:
- I don't know what is the root cause (i.e. how come it works in B)
- I do want that flag [
-Werror
] (this can be solved by adding-Wno-deprecated
and then returning the
-Werror
, but I don't think of it as a good solution. More like a hack)
My question: What in A can cause this deprecated warning that does not apply in B?
Using powerpc-linux-gnu-g++ (Sourcery G++ Lite 4.3-74) 4.3.2
Note: I know that deprecated Indicates that the name or entity declared with this attribute is deprecated, that is, the use is allowed, but discouraged for some reason.
c++ compiler-errors g++ deprecated
c++ compiler-errors g++ deprecated
edited Nov 14 '18 at 14:23
StoryTeller
98.6k12201269
98.6k12201269
asked Nov 14 '18 at 13:35
CIsForCookiesCIsForCookies
6,81211648
6,81211648
could be many things. eg in gcc you can silence warnings when a header is included via-isystem
– user463035818
Nov 14 '18 at 13:44
1
This is not a solution, this is one of many things that could make the warning not to appear inB
. We cannot guess. At this point, this is just opinions you're asking.
– YSC
Nov 14 '18 at 13:47
1
the symptom is that a warning is surpressed, what is the cause i have no clue ;)
– user463035818
Nov 14 '18 at 13:48
2
Just so I understood: You have two compilation units in individual compiler invocations, using identicallibssh.h
(except for path) and identical compiler options, both using the deprecated function, but only one giving the warning? In that case the exact compiler command line and MCVEs of the two compilation units would be helpful.
– user10605163
Nov 14 '18 at 13:49
1
If you expect your post to be read by actual people, then I suggest you don't do something ghastly like striking through the whole of the text you still refer too!
– StoryTeller
Nov 14 '18 at 14:23
|
show 7 more comments
could be many things. eg in gcc you can silence warnings when a header is included via-isystem
– user463035818
Nov 14 '18 at 13:44
1
This is not a solution, this is one of many things that could make the warning not to appear inB
. We cannot guess. At this point, this is just opinions you're asking.
– YSC
Nov 14 '18 at 13:47
1
the symptom is that a warning is surpressed, what is the cause i have no clue ;)
– user463035818
Nov 14 '18 at 13:48
2
Just so I understood: You have two compilation units in individual compiler invocations, using identicallibssh.h
(except for path) and identical compiler options, both using the deprecated function, but only one giving the warning? In that case the exact compiler command line and MCVEs of the two compilation units would be helpful.
– user10605163
Nov 14 '18 at 13:49
1
If you expect your post to be read by actual people, then I suggest you don't do something ghastly like striking through the whole of the text you still refer too!
– StoryTeller
Nov 14 '18 at 14:23
could be many things. eg in gcc you can silence warnings when a header is included via
-isystem
– user463035818
Nov 14 '18 at 13:44
could be many things. eg in gcc you can silence warnings when a header is included via
-isystem
– user463035818
Nov 14 '18 at 13:44
1
1
This is not a solution, this is one of many things that could make the warning not to appear in
B
. We cannot guess. At this point, this is just opinions you're asking.– YSC
Nov 14 '18 at 13:47
This is not a solution, this is one of many things that could make the warning not to appear in
B
. We cannot guess. At this point, this is just opinions you're asking.– YSC
Nov 14 '18 at 13:47
1
1
the symptom is that a warning is surpressed, what is the cause i have no clue ;)
– user463035818
Nov 14 '18 at 13:48
the symptom is that a warning is surpressed, what is the cause i have no clue ;)
– user463035818
Nov 14 '18 at 13:48
2
2
Just so I understood: You have two compilation units in individual compiler invocations, using identical
libssh.h
(except for path) and identical compiler options, both using the deprecated function, but only one giving the warning? In that case the exact compiler command line and MCVEs of the two compilation units would be helpful.– user10605163
Nov 14 '18 at 13:49
Just so I understood: You have two compilation units in individual compiler invocations, using identical
libssh.h
(except for path) and identical compiler options, both using the deprecated function, but only one giving the warning? In that case the exact compiler command line and MCVEs of the two compilation units would be helpful.– user10605163
Nov 14 '18 at 13:49
1
1
If you expect your post to be read by actual people, then I suggest you don't do something ghastly like striking through the whole of the text you still refer too!
– StoryTeller
Nov 14 '18 at 14:23
If you expect your post to be read by actual people, then I suggest you don't do something ghastly like striking through the whole of the text you still refer too!
– StoryTeller
Nov 14 '18 at 14:23
|
show 7 more comments
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53301496%2fg-does-not-ignore-deprecated-declaration-werror-error-when-using-wno-d%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53301496%2fg-does-not-ignore-deprecated-declaration-werror-error-when-using-wno-d%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
could be many things. eg in gcc you can silence warnings when a header is included via
-isystem
– user463035818
Nov 14 '18 at 13:44
1
This is not a solution, this is one of many things that could make the warning not to appear in
B
. We cannot guess. At this point, this is just opinions you're asking.– YSC
Nov 14 '18 at 13:47
1
the symptom is that a warning is surpressed, what is the cause i have no clue ;)
– user463035818
Nov 14 '18 at 13:48
2
Just so I understood: You have two compilation units in individual compiler invocations, using identical
libssh.h
(except for path) and identical compiler options, both using the deprecated function, but only one giving the warning? In that case the exact compiler command line and MCVEs of the two compilation units would be helpful.– user10605163
Nov 14 '18 at 13:49
1
If you expect your post to be read by actual people, then I suggest you don't do something ghastly like striking through the whole of the text you still refer too!
– StoryTeller
Nov 14 '18 at 14:23