[jira] [Commented] (PROTON-2772) [c] Add parameter safety annotations for printf format strings
[ https://issues.apache.org/jira/browse/PROTON-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17805143#comment-17805143 ] ASF GitHub Bot commented on PROTON-2772: jiridanek merged PR #419: URL: https://github.com/apache/qpid-proton/pull/419 > [c] Add parameter safety annotations for printf format strings > -- > > Key: PROTON-2772 > URL: https://issues.apache.org/jira/browse/PROTON-2772 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-c >Affects Versions: proton-c-0.39.0 >Reporter: Jiri Daněk >Assignee: Jiri Daněk >Priority: Major > Fix For: proton-c-0.40.0 > > > There seem to be various mismatched printf format arguments. This is best > resolved by annotating the string format parameters so that regular > compilation warns on the mismatches as they happen. > Proton already has some of this, but it is incomplete. > {noformat} > ``` > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c: In function > ‘pni_logger_log_raw’: > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c:204:41: error: format > ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type > ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=] > 204 | pn_fixed_string_addf(, "%04x/%04x: ", i, size); > | ~~~^ > | || > | |size_t {aka long > unsigned int} > | unsigned int > | %04lx > cc1: all warnings being treated as errors > ``` > {noformat} > On windows, we want to enable these optional warning flags > {noformat} > "/analyzer" > "/we6328" # Size mismatch: 'unsigned __int64' passed as _Param_(4) when 'int' > is required in call to 'ssl_log'. > "/we6340" # Mismatch on sign: 'unsigned __int64' passed as _Param_(4) when > some signed type is required in call to 'ssl_log'. > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (PROTON-2772) [c] Add parameter safety annotations for printf format strings
[ https://issues.apache.org/jira/browse/PROTON-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17805144#comment-17805144 ] ASF subversion and git services commented on PROTON-2772: - Commit a175b5ee28949a982f60022f927bd457873cb1fd in qpid-proton's branch refs/heads/main from Jiri Daněk [ https://gitbox.apache.org/repos/asf?p=qpid-proton.git;h=a175b5ee2 ] PROTON-2772: add printf format arg annotations to satisfy MSVC (#419) > [c] Add parameter safety annotations for printf format strings > -- > > Key: PROTON-2772 > URL: https://issues.apache.org/jira/browse/PROTON-2772 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-c >Affects Versions: proton-c-0.39.0 >Reporter: Jiri Daněk >Assignee: Jiri Daněk >Priority: Major > Fix For: proton-c-0.40.0 > > > There seem to be various mismatched printf format arguments. This is best > resolved by annotating the string format parameters so that regular > compilation warns on the mismatches as they happen. > Proton already has some of this, but it is incomplete. > {noformat} > ``` > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c: In function > ‘pni_logger_log_raw’: > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c:204:41: error: format > ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type > ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=] > 204 | pn_fixed_string_addf(, "%04x/%04x: ", i, size); > | ~~~^ > | || > | |size_t {aka long > unsigned int} > | unsigned int > | %04lx > cc1: all warnings being treated as errors > ``` > {noformat} > On windows, we want to enable these optional warning flags > {noformat} > "/analyzer" > "/we6328" # Size mismatch: 'unsigned __int64' passed as _Param_(4) when 'int' > is required in call to 'ssl_log'. > "/we6340" # Mismatch on sign: 'unsigned __int64' passed as _Param_(4) when > some signed type is required in call to 'ssl_log'. > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (PROTON-2772) [c] Add parameter safety annotations for printf format strings
[ https://issues.apache.org/jira/browse/PROTON-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17804005#comment-17804005 ] ASF GitHub Bot commented on PROTON-2772: jiridanek commented on code in PR #419: URL: https://github.com/apache/qpid-proton/pull/419#discussion_r1444071641 ## c/src/core/engine.c: ## @@ -1645,9 +1645,9 @@ void pn_delivery_dump(pn_delivery_t *d) printf("{tag=%s, local.type=%" PRIu64 ", remote.type=%" PRIu64 ", local.settled=%u, " "remote.settled=%u, updated=%u, current=%u, writable=%u, readable=%u, " "work=%u}", - tag, d->local.type, d->remote.type, d->local.settled, - d->remote.settled, d->updated, pn_delivery_current(d), - pn_delivery_writable(d), pn_delivery_readable(d), d->work); + tag, d->local.type, d->remote.type, (unsigned)d->local.settled, + (unsigned)d->remote.settled, (unsigned)d->updated, (unsigned)pn_delivery_current(d), + (unsigned)pn_delivery_writable(d), (unsigned)pn_delivery_readable(d), (unsigned)d->work); Review Comment: I'm changing this to %d > [c] Add parameter safety annotations for printf format strings > -- > > Key: PROTON-2772 > URL: https://issues.apache.org/jira/browse/PROTON-2772 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-c >Affects Versions: proton-c-0.39.0 >Reporter: Jiri Daněk >Assignee: Jiri Daněk >Priority: Major > Fix For: proton-c-0.40.0 > > > There seem to be various mismatched printf format arguments. This is best > resolved by annotating the string format parameters so that regular > compilation warns on the mismatches as they happen. > Proton already has some of this, but it is incomplete. > {noformat} > ``` > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c: In function > ‘pni_logger_log_raw’: > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c:204:41: error: format > ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type > ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=] > 204 | pn_fixed_string_addf(, "%04x/%04x: ", i, size); > | ~~~^ > | || > | |size_t {aka long > unsigned int} > | unsigned int > | %04lx > cc1: all warnings being treated as errors > ``` > {noformat} > On windows, we want to enable these optional warning flags > {noformat} > "/analyzer" > "/we6328" # Size mismatch: 'unsigned __int64' passed as _Param_(4) when 'int' > is required in call to 'ssl_log'. > "/we6340" # Mismatch on sign: 'unsigned __int64' passed as _Param_(4) when > some signed type is required in call to 'ssl_log'. > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (PROTON-2772) [c] Add parameter safety annotations for printf format strings
[ https://issues.apache.org/jira/browse/PROTON-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17804006#comment-17804006 ] ASF GitHub Bot commented on PROTON-2772: jiridanek commented on code in PR #419: URL: https://github.com/apache/qpid-proton/pull/419#discussion_r1444071676 ## c/src/core/encoder.c: ## @@ -78,7 +78,7 @@ static uint8_t pn_type2code(pn_encoder_t *encoder, pn_type_t type) case PN_MAP: return PNE_MAP32; case PN_DESCRIBED: return PNE_DESCRIPTOR; default: -return pn_error_format(pni_encoder_error(encoder), PN_ERR, "not a value type: %u\n", type); +return pn_error_format(pni_encoder_error(encoder), PN_ERR, "not a value type: %u\n", (unsigned int)type); Review Comment: Let;s go with %d as well > [c] Add parameter safety annotations for printf format strings > -- > > Key: PROTON-2772 > URL: https://issues.apache.org/jira/browse/PROTON-2772 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-c >Affects Versions: proton-c-0.39.0 >Reporter: Jiri Daněk >Assignee: Jiri Daněk >Priority: Major > Fix For: proton-c-0.40.0 > > > There seem to be various mismatched printf format arguments. This is best > resolved by annotating the string format parameters so that regular > compilation warns on the mismatches as they happen. > Proton already has some of this, but it is incomplete. > {noformat} > ``` > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c: In function > ‘pni_logger_log_raw’: > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c:204:41: error: format > ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type > ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=] > 204 | pn_fixed_string_addf(, "%04x/%04x: ", i, size); > | ~~~^ > | || > | |size_t {aka long > unsigned int} > | unsigned int > | %04lx > cc1: all warnings being treated as errors > ``` > {noformat} > On windows, we want to enable these optional warning flags > {noformat} > "/analyzer" > "/we6328" # Size mismatch: 'unsigned __int64' passed as _Param_(4) when 'int' > is required in call to 'ssl_log'. > "/we6340" # Mismatch on sign: 'unsigned __int64' passed as _Param_(4) when > some signed type is required in call to 'ssl_log'. > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (PROTON-2772) [c] Add parameter safety annotations for printf format strings
[ https://issues.apache.org/jira/browse/PROTON-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17804004#comment-17804004 ] ASF GitHub Bot commented on PROTON-2772: jiridanek commented on code in PR #419: URL: https://github.com/apache/qpid-proton/pull/419#discussion_r1444069607 ## c/src/core/encoder.c: ## @@ -78,7 +78,7 @@ static uint8_t pn_type2code(pn_encoder_t *encoder, pn_type_t type) case PN_MAP: return PNE_MAP32; case PN_DESCRIBED: return PNE_DESCRIPTOR; default: -return pn_error_format(pni_encoder_error(encoder), PN_ERR, "not a value type: %u\n", type); +return pn_error_format(pni_encoder_error(encoder), PN_ERR, "not a value type: %u\n", (unsigned int)type); Review Comment: This is about printing an enum, the compiler is unhappy with `%u`. Not really sure what's the nicest way to resolve this. In C23, it will be possible to specify a backing type for enum. Nowadays, if I read correctly, iti is either a char, int, or unsigned int. Wouldn't maybe treating it as an int work better here? So %d and (int) cast? > [c] Add parameter safety annotations for printf format strings > -- > > Key: PROTON-2772 > URL: https://issues.apache.org/jira/browse/PROTON-2772 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-c >Affects Versions: proton-c-0.39.0 >Reporter: Jiri Daněk >Assignee: Jiri Daněk >Priority: Major > Fix For: proton-c-0.40.0 > > > There seem to be various mismatched printf format arguments. This is best > resolved by annotating the string format parameters so that regular > compilation warns on the mismatches as they happen. > Proton already has some of this, but it is incomplete. > {noformat} > ``` > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c: In function > ‘pni_logger_log_raw’: > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c:204:41: error: format > ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type > ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=] > 204 | pn_fixed_string_addf(, "%04x/%04x: ", i, size); > | ~~~^ > | || > | |size_t {aka long > unsigned int} > | unsigned int > | %04lx > cc1: all warnings being treated as errors > ``` > {noformat} > On windows, we want to enable these optional warning flags > {noformat} > "/analyzer" > "/we6328" # Size mismatch: 'unsigned __int64' passed as _Param_(4) when 'int' > is required in call to 'ssl_log'. > "/we6340" # Mismatch on sign: 'unsigned __int64' passed as _Param_(4) when > some signed type is required in call to 'ssl_log'. > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (PROTON-2772) [c] Add parameter safety annotations for printf format strings
[ https://issues.apache.org/jira/browse/PROTON-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17804002#comment-17804002 ] ASF GitHub Bot commented on PROTON-2772: jiridanek commented on code in PR #419: URL: https://github.com/apache/qpid-proton/pull/419#discussion_r1444068569 ## c/src/core/engine.c: ## @@ -1645,9 +1645,9 @@ void pn_delivery_dump(pn_delivery_t *d) printf("{tag=%s, local.type=%" PRIu64 ", remote.type=%" PRIu64 ", local.settled=%u, " "remote.settled=%u, updated=%u, current=%u, writable=%u, readable=%u, " "work=%u}", - tag, d->local.type, d->remote.type, d->local.settled, - d->remote.settled, d->updated, pn_delivery_current(d), - pn_delivery_writable(d), pn_delivery_readable(d), d->work); + tag, d->local.type, d->remote.type, (unsigned)d->local.settled, + (unsigned)d->remote.settled, (unsigned)d->updated, (unsigned)pn_delivery_current(d), + (unsigned)pn_delivery_writable(d), (unsigned)pn_delivery_readable(d), (unsigned)d->work); Review Comment: MSVC would be happy to print `bool`s with `%i`, but `%u` it does not like. Maybe just go with `%i` or `%d` instead? > [c] Add parameter safety annotations for printf format strings > -- > > Key: PROTON-2772 > URL: https://issues.apache.org/jira/browse/PROTON-2772 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-c >Affects Versions: proton-c-0.39.0 >Reporter: Jiri Daněk >Assignee: Jiri Daněk >Priority: Major > Fix For: proton-c-0.40.0 > > > There seem to be various mismatched printf format arguments. This is best > resolved by annotating the string format parameters so that regular > compilation warns on the mismatches as they happen. > Proton already has some of this, but it is incomplete. > {noformat} > ``` > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c: In function > ‘pni_logger_log_raw’: > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c:204:41: error: format > ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type > ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=] > 204 | pn_fixed_string_addf(, "%04x/%04x: ", i, size); > | ~~~^ > | || > | |size_t {aka long > unsigned int} > | unsigned int > | %04lx > cc1: all warnings being treated as errors > ``` > {noformat} > On windows, we want to enable these optional warning flags > {noformat} > "/analyzer" > "/we6328" # Size mismatch: 'unsigned __int64' passed as _Param_(4) when 'int' > is required in call to 'ssl_log'. > "/we6340" # Mismatch on sign: 'unsigned __int64' passed as _Param_(4) when > some signed type is required in call to 'ssl_log'. > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (PROTON-2772) [c] Add parameter safety annotations for printf format strings
[ https://issues.apache.org/jira/browse/PROTON-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17804001#comment-17804001 ] ASF GitHub Bot commented on PROTON-2772: jiridanek opened a new pull request, #419: URL: https://github.com/apache/qpid-proton/pull/419 (no comment) > [c] Add parameter safety annotations for printf format strings > -- > > Key: PROTON-2772 > URL: https://issues.apache.org/jira/browse/PROTON-2772 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-c >Affects Versions: proton-c-0.39.0 >Reporter: Jiri Daněk >Assignee: Jiri Daněk >Priority: Major > Fix For: proton-c-0.40.0 > > > There seem to be various mismatched printf format arguments. This is best > resolved by annotating the string format parameters so that regular > compilation warns on the mismatches as they happen. > Proton already has some of this, but it is incomplete. > {noformat} > ``` > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c: In function > ‘pni_logger_log_raw’: > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c:204:41: error: format > ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type > ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=] > 204 | pn_fixed_string_addf(, "%04x/%04x: ", i, size); > | ~~~^ > | || > | |size_t {aka long > unsigned int} > | unsigned int > | %04lx > cc1: all warnings being treated as errors > ``` > {noformat} > On windows, we want to enable these optional warning flags > {noformat} > "/analyzer" > "/we6328" # Size mismatch: 'unsigned __int64' passed as _Param_(4) when 'int' > is required in call to 'ssl_log'. > "/we6340" # Mismatch on sign: 'unsigned __int64' passed as _Param_(4) when > some signed type is required in call to 'ssl_log'. > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (PROTON-2772) [c] Add parameter safety annotations for printf format strings
[ https://issues.apache.org/jira/browse/PROTON-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17803998#comment-17803998 ] ASF GitHub Bot commented on PROTON-2772: jiridanek merged PR #409: URL: https://github.com/apache/qpid-proton/pull/409 > [c] Add parameter safety annotations for printf format strings > -- > > Key: PROTON-2772 > URL: https://issues.apache.org/jira/browse/PROTON-2772 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-c >Affects Versions: proton-c-0.39.0 >Reporter: Jiri Daněk >Assignee: Jiri Daněk >Priority: Major > Fix For: proton-c-0.40.0 > > > There seem to be various mismatched printf format arguments. This is best > resolved by annotating the string format parameters so that regular > compilation warns on the mismatches as they happen. > Proton already has some of this, but it is incomplete. > {noformat} > ``` > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c: In function > ‘pni_logger_log_raw’: > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c:204:41: error: format > ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type > ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=] > 204 | pn_fixed_string_addf(, "%04x/%04x: ", i, size); > | ~~~^ > | || > | |size_t {aka long > unsigned int} > | unsigned int > | %04lx > cc1: all warnings being treated as errors > ``` > {noformat} > On windows, we want to enable these optional warning flags > {noformat} > "/analyzer" > "/we6328" # Size mismatch: 'unsigned __int64' passed as _Param_(4) when 'int' > is required in call to 'ssl_log'. > "/we6340" # Mismatch on sign: 'unsigned __int64' passed as _Param_(4) when > some signed type is required in call to 'ssl_log'. > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (PROTON-2772) [c] Add parameter safety annotations for printf format strings
[ https://issues.apache.org/jira/browse/PROTON-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17803999#comment-17803999 ] ASF subversion and git services commented on PROTON-2772: - Commit 99e0d1f7277b50ffb061f3dfac773afa042a23dc in qpid-proton's branch refs/heads/main from Jiri Daněk [ https://gitbox.apache.org/repos/asf?p=qpid-proton.git;h=99e0d1f72 ] PROTON-2772: add printf format arg annotations to satisfy MSVC > [c] Add parameter safety annotations for printf format strings > -- > > Key: PROTON-2772 > URL: https://issues.apache.org/jira/browse/PROTON-2772 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-c >Affects Versions: proton-c-0.39.0 >Reporter: Jiri Daněk >Assignee: Jiri Daněk >Priority: Major > Fix For: proton-c-0.40.0 > > > There seem to be various mismatched printf format arguments. This is best > resolved by annotating the string format parameters so that regular > compilation warns on the mismatches as they happen. > Proton already has some of this, but it is incomplete. > {noformat} > ``` > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c: In function > ‘pni_logger_log_raw’: > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c:204:41: error: format > ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type > ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=] > 204 | pn_fixed_string_addf(, "%04x/%04x: ", i, size); > | ~~~^ > | || > | |size_t {aka long > unsigned int} > | unsigned int > | %04lx > cc1: all warnings being treated as errors > ``` > {noformat} > On windows, we want to enable these optional warning flags > {noformat} > "/analyzer" > "/we6328" # Size mismatch: 'unsigned __int64' passed as _Param_(4) when 'int' > is required in call to 'ssl_log'. > "/we6340" # Mismatch on sign: 'unsigned __int64' passed as _Param_(4) when > some signed type is required in call to 'ssl_log'. > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (PROTON-2772) [c] Add parameter safety annotations for printf format strings
[ https://issues.apache.org/jira/browse/PROTON-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17803989#comment-17803989 ] ASF GitHub Bot commented on PROTON-2772: jiridanek commented on PR #409: URL: https://github.com/apache/qpid-proton/pull/409#issuecomment-1880137421 This has been here for a long time with no objections raised. I'm going to squash the commits and merge this first part (annotations and CMakeLists.txt flags). I'll create a new PR for actually fixing the warnings and I'll leave it here for review next. > [c] Add parameter safety annotations for printf format strings > -- > > Key: PROTON-2772 > URL: https://issues.apache.org/jira/browse/PROTON-2772 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-c >Affects Versions: proton-c-0.39.0 >Reporter: Jiri Daněk >Assignee: Jiri Daněk >Priority: Major > Fix For: proton-c-0.40.0 > > > There seem to be various mismatched printf format arguments. This is best > resolved by annotating the string format parameters so that regular > compilation warns on the mismatches as they happen. > Proton already has some of this, but it is incomplete. > {noformat} > ``` > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c: In function > ‘pni_logger_log_raw’: > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c:204:41: error: format > ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type > ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=] > 204 | pn_fixed_string_addf(, "%04x/%04x: ", i, size); > | ~~~^ > | || > | |size_t {aka long > unsigned int} > | unsigned int > | %04lx > cc1: all warnings being treated as errors > ``` > {noformat} > On windows, we want to enable these optional warning flags > {noformat} > "/analyzer" > "/we6328" # Size mismatch: 'unsigned __int64' passed as _Param_(4) when 'int' > is required in call to 'ssl_log'. > "/we6340" # Mismatch on sign: 'unsigned __int64' passed as _Param_(4) when > some signed type is required in call to 'ssl_log'. > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (PROTON-2772) [c] Add parameter safety annotations for printf format strings
[ https://issues.apache.org/jira/browse/PROTON-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17803960#comment-17803960 ] ASF GitHub Bot commented on PROTON-2772: jiridanek commented on PR #409: URL: https://github.com/apache/qpid-proton/pull/409#issuecomment-1880060298 My plan here is to boot up Windows, add all the new warnings on MSVC to the CMakeLists.txt as suppressed, and merge that. I will add comments what these numbers mean. I'll consider putting this into a separate cmake file if the list of suppressions becomes very long. I imagine this might be hard to maintain if we ever wanted to do warnings-as-errors on msvc, or if msvc then fails when compiling on an older version which does not know some particular warning flag (gcc does this). I will not try to do warnings-as-errors on MSVC to be sure. > [c] Add parameter safety annotations for printf format strings > -- > > Key: PROTON-2772 > URL: https://issues.apache.org/jira/browse/PROTON-2772 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-c >Affects Versions: proton-c-0.39.0 >Reporter: Jiri Daněk >Assignee: Jiri Daněk >Priority: Major > Fix For: proton-c-0.40.0 > > > There seem to be various mismatched printf format arguments. This is best > resolved by annotating the string format parameters so that regular > compilation warns on the mismatches as they happen. > Proton already has some of this, but it is incomplete. > {noformat} > ``` > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c: In function > ‘pni_logger_log_raw’: > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c:204:41: error: format > ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type > ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=] > 204 | pn_fixed_string_addf(, "%04x/%04x: ", i, size); > | ~~~^ > | || > | |size_t {aka long > unsigned int} > | unsigned int > | %04lx > cc1: all warnings being treated as errors > ``` > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (PROTON-2772) [c] Add parameter safety annotations for printf format strings
[ https://issues.apache.org/jira/browse/PROTON-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17781253#comment-17781253 ] ASF subversion and git services commented on PROTON-2772: - Commit b22b11bfca3a9d25f493c95c9685b7c80608b73e in qpid-proton's branch refs/heads/main from Jiri Daněk [ https://gitbox.apache.org/repos/asf?p=qpid-proton.git;h=b22b11bfc ] PROTON-2772: add compiler warning management macros > [c] Add parameter safety annotations for printf format strings > -- > > Key: PROTON-2772 > URL: https://issues.apache.org/jira/browse/PROTON-2772 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-c >Affects Versions: proton-c-0.39.0 >Reporter: Jiri Daněk >Assignee: Jiri Daněk >Priority: Major > Fix For: proton-c-0.40.0 > > > There seem to be various mismatched printf format arguments. This is best > resolved by annotating the string format parameters so that regular > compilation warns on the mismatches as they happen. > Proton already has some of this, but it is incomplete. > {noformat} > ``` > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c: In function > ‘pni_logger_log_raw’: > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c:204:41: error: format > ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type > ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=] > 204 | pn_fixed_string_addf(, "%04x/%04x: ", i, size); > | ~~~^ > | || > | |size_t {aka long > unsigned int} > | unsigned int > | %04lx > cc1: all warnings being treated as errors > ``` > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (PROTON-2772) [c] Add parameter safety annotations for printf format strings
[ https://issues.apache.org/jira/browse/PROTON-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17781254#comment-17781254 ] ASF subversion and git services commented on PROTON-2772: - Commit 058dcaa83a7e96e6f169e38750a05c51915800e8 in qpid-proton's branch refs/heads/main from Jiri Daněk [ https://gitbox.apache.org/repos/asf?p=qpid-proton.git;h=058dcaa83 ] PROTON-2772: disable -wcast-function-type warning This is a notorious problem where passing in function handles inevitably results in this kind of unsafe casting. > [c] Add parameter safety annotations for printf format strings > -- > > Key: PROTON-2772 > URL: https://issues.apache.org/jira/browse/PROTON-2772 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-c >Affects Versions: proton-c-0.39.0 >Reporter: Jiri Daněk >Assignee: Jiri Daněk >Priority: Major > Fix For: proton-c-0.40.0 > > > There seem to be various mismatched printf format arguments. This is best > resolved by annotating the string format parameters so that regular > compilation warns on the mismatches as they happen. > Proton already has some of this, but it is incomplete. > {noformat} > ``` > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c: In function > ‘pni_logger_log_raw’: > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c:204:41: error: format > ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type > ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=] > 204 | pn_fixed_string_addf(, "%04x/%04x: ", i, size); > | ~~~^ > | || > | |size_t {aka long > unsigned int} > | unsigned int > | %04lx > cc1: all warnings being treated as errors > ``` > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (PROTON-2772) [c] Add parameter safety annotations for printf format strings
[ https://issues.apache.org/jira/browse/PROTON-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17781252#comment-17781252 ] ASF GitHub Bot commented on PROTON-2772: jiridanek merged PR #413: URL: https://github.com/apache/qpid-proton/pull/413 > [c] Add parameter safety annotations for printf format strings > -- > > Key: PROTON-2772 > URL: https://issues.apache.org/jira/browse/PROTON-2772 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-c >Affects Versions: proton-c-0.39.0 >Reporter: Jiri Daněk >Assignee: Jiri Daněk >Priority: Major > Fix For: proton-c-0.40.0 > > > There seem to be various mismatched printf format arguments. This is best > resolved by annotating the string format parameters so that regular > compilation warns on the mismatches as they happen. > Proton already has some of this, but it is incomplete. > {noformat} > ``` > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c: In function > ‘pni_logger_log_raw’: > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c:204:41: error: format > ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type > ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=] > 204 | pn_fixed_string_addf(, "%04x/%04x: ", i, size); > | ~~~^ > | || > | |size_t {aka long > unsigned int} > | unsigned int > | %04lx > cc1: all warnings being treated as errors > ``` > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (PROTON-2772) [c] Add parameter safety annotations for printf format strings
[ https://issues.apache.org/jira/browse/PROTON-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17778061#comment-17778061 ] ASF GitHub Bot commented on PROTON-2772: jiridanek opened a new pull request, #413: URL: https://github.com/apache/qpid-proton/pull/413 The motivation is again composite build with skupper-router, which enables a warning on this function cast. > [c] Add parameter safety annotations for printf format strings > -- > > Key: PROTON-2772 > URL: https://issues.apache.org/jira/browse/PROTON-2772 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-c >Affects Versions: proton-c-0.39.0 >Reporter: Jiri Daněk >Assignee: Jiri Daněk >Priority: Major > Fix For: proton-c-0.40.0 > > > There seem to be various mismatched printf format arguments. This is best > resolved by annotating the string format parameters so that regular > compilation warns on the mismatches as they happen. > Proton already has some of this, but it is incomplete. > {noformat} > ``` > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c: In function > ‘pni_logger_log_raw’: > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c:204:41: error: format > ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type > ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=] > 204 | pn_fixed_string_addf(, "%04x/%04x: ", i, size); > | ~~~^ > | || > | |size_t {aka long > unsigned int} > | unsigned int > | %04lx > cc1: all warnings being treated as errors > ``` > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (PROTON-2772) [c] Add parameter safety annotations for printf format strings
[ https://issues.apache.org/jira/browse/PROTON-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17775265#comment-17775265 ] ASF GitHub Bot commented on PROTON-2772: jiridanek commented on PR #409: URL: https://github.com/apache/qpid-proton/pull/409#issuecomment-1762995906 This PR currently only reveals the issues, it does not try to fix them. There is few tens of warnings generated, for C6328 and C6340 warnings. https://github.com/jiridanek/qpid-proton/actions/runs/6518361158/job/17703711656#step:12:810 The output of MSVC becomes quite messy when /analyze is enabled. Any suggestions what should be done about it would be most welcome. I _could_ just disable them one by one... and leave them for consideration at some time in the future. > [c] Add parameter safety annotations for printf format strings > -- > > Key: PROTON-2772 > URL: https://issues.apache.org/jira/browse/PROTON-2772 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-c >Affects Versions: proton-c-0.39.0 >Reporter: Jiri Daněk >Assignee: Jiri Daněk >Priority: Major > Fix For: proton-c-0.40.0 > > > There seem to be various mismatched printf format arguments. This is best > resolved by annotating the string format parameters so that regular > compilation warns on the mismatches as they happen. > Proton already has some of this, but it is incomplete. > {noformat} > ``` > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c: In function > ‘pni_logger_log_raw’: > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c:204:41: error: format > ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type > ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=] > 204 | pn_fixed_string_addf(, "%04x/%04x: ", i, size); > | ~~~^ > | || > | |size_t {aka long > unsigned int} > | unsigned int > | %04lx > cc1: all warnings being treated as errors > ``` > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (PROTON-2772) [c] Add parameter safety annotations for printf format strings
[ https://issues.apache.org/jira/browse/PROTON-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17775263#comment-17775263 ] ASF GitHub Bot commented on PROTON-2772: jiridanek commented on PR #407: URL: https://github.com/apache/qpid-proton/pull/407#issuecomment-1762994940 * Superseded by https://github.com/apache/qpid-proton/pull/409 > [c] Add parameter safety annotations for printf format strings > -- > > Key: PROTON-2772 > URL: https://issues.apache.org/jira/browse/PROTON-2772 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-c >Affects Versions: proton-c-0.39.0 >Reporter: Jiri Daněk >Assignee: Jiri Daněk >Priority: Major > Fix For: proton-c-0.40.0 > > > There seem to be various mismatched printf format arguments. This is best > resolved by annotating the string format parameters so that regular > compilation warns on the mismatches as they happen. > Proton already has some of this, but it is incomplete. > {noformat} > ``` > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c: In function > ‘pni_logger_log_raw’: > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c:204:41: error: format > ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type > ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=] > 204 | pn_fixed_string_addf(, "%04x/%04x: ", i, size); > | ~~~^ > | || > | |size_t {aka long > unsigned int} > | unsigned int > | %04lx > cc1: all warnings being treated as errors > ``` > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (PROTON-2772) [c] Add parameter safety annotations for printf format strings
[ https://issues.apache.org/jira/browse/PROTON-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17775264#comment-17775264 ] ASF GitHub Bot commented on PROTON-2772: jiridanek closed pull request #407: PROTON-2772: add format arg annotations for schannel functions URL: https://github.com/apache/qpid-proton/pull/407 > [c] Add parameter safety annotations for printf format strings > -- > > Key: PROTON-2772 > URL: https://issues.apache.org/jira/browse/PROTON-2772 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-c >Affects Versions: proton-c-0.39.0 >Reporter: Jiri Daněk >Assignee: Jiri Daněk >Priority: Major > Fix For: proton-c-0.40.0 > > > There seem to be various mismatched printf format arguments. This is best > resolved by annotating the string format parameters so that regular > compilation warns on the mismatches as they happen. > Proton already has some of this, but it is incomplete. > {noformat} > ``` > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c: In function > ‘pni_logger_log_raw’: > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c:204:41: error: format > ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type > ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=] > 204 | pn_fixed_string_addf(, "%04x/%04x: ", i, size); > | ~~~^ > | || > | |size_t {aka long > unsigned int} > | unsigned int > | %04lx > cc1: all warnings being treated as errors > ``` > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (PROTON-2772) [c] Add parameter safety annotations for printf format strings
[ https://issues.apache.org/jira/browse/PROTON-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17775262#comment-17775262 ] ASF GitHub Bot commented on PROTON-2772: jiridanek opened a new pull request, #409: URL: https://github.com/apache/qpid-proton/pull/409 (no comment) > [c] Add parameter safety annotations for printf format strings > -- > > Key: PROTON-2772 > URL: https://issues.apache.org/jira/browse/PROTON-2772 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-c >Affects Versions: proton-c-0.39.0 >Reporter: Jiri Daněk >Assignee: Jiri Daněk >Priority: Major > Fix For: proton-c-0.40.0 > > > There seem to be various mismatched printf format arguments. This is best > resolved by annotating the string format parameters so that regular > compilation warns on the mismatches as they happen. > Proton already has some of this, but it is incomplete. > {noformat} > ``` > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c: In function > ‘pni_logger_log_raw’: > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c:204:41: error: format > ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type > ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=] > 204 | pn_fixed_string_addf(, "%04x/%04x: ", i, size); > | ~~~^ > | || > | |size_t {aka long > unsigned int} > | unsigned int > | %04lx > cc1: all warnings being treated as errors > ``` > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (PROTON-2772) [c] Add parameter safety annotations for printf format strings
[ https://issues.apache.org/jira/browse/PROTON-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17775237#comment-17775237 ] ASF GitHub Bot commented on PROTON-2772: jiridanek commented on PR #406: URL: https://github.com/apache/qpid-proton/pull/406#issuecomment-1762922429 I made the PR from a wrong branch, and apparently it is not possible to rename a branch when there is already a PR from that branch. * PR recreated as https://github.com/apache/qpid-proton/pull/407 > [c] Add parameter safety annotations for printf format strings > -- > > Key: PROTON-2772 > URL: https://issues.apache.org/jira/browse/PROTON-2772 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-c >Affects Versions: proton-c-0.39.0 >Reporter: Jiri Daněk >Assignee: Jiri Daněk >Priority: Major > Fix For: proton-c-0.40.0 > > > There seem to be various mismatched printf format arguments. This is best > resolved by annotating the string format parameters so that regular > compilation warns on the mismatches as they happen. > Proton already has some of this, but it is incomplete. > {noformat} > ``` > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c: In function > ‘pni_logger_log_raw’: > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c:204:41: error: format > ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type > ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=] > 204 | pn_fixed_string_addf(, "%04x/%04x: ", i, size); > | ~~~^ > | || > | |size_t {aka long > unsigned int} > | unsigned int > | %04lx > cc1: all warnings being treated as errors > ``` > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (PROTON-2772) [c] Add parameter safety annotations for printf format strings
[ https://issues.apache.org/jira/browse/PROTON-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17775236#comment-17775236 ] ASF GitHub Bot commented on PROTON-2772: jiridanek opened a new pull request, #407: URL: https://github.com/apache/qpid-proton/pull/407 What's missing is a compilation failure when any warnings are emitted. MSVC needs /analyze to report the problems, there is actually lots of diagnostics printed then, and the mismatched format args are not causing compilation to fail so the warnings are easy to miss. > [c] Add parameter safety annotations for printf format strings > -- > > Key: PROTON-2772 > URL: https://issues.apache.org/jira/browse/PROTON-2772 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-c >Affects Versions: proton-c-0.39.0 >Reporter: Jiri Daněk >Assignee: Jiri Daněk >Priority: Major > Fix For: proton-c-0.40.0 > > > There seem to be various mismatched printf format arguments. This is best > resolved by annotating the string format parameters so that regular > compilation warns on the mismatches as they happen. > Proton already has some of this, but it is incomplete. > {noformat} > ``` > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c: In function > ‘pni_logger_log_raw’: > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c:204:41: error: format > ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type > ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=] > 204 | pn_fixed_string_addf(, "%04x/%04x: ", i, size); > | ~~~^ > | || > | |size_t {aka long > unsigned int} > | unsigned int > | %04lx > cc1: all warnings being treated as errors > ``` > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (PROTON-2772) [c] Add parameter safety annotations for printf format strings
[ https://issues.apache.org/jira/browse/PROTON-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17775235#comment-17775235 ] ASF GitHub Bot commented on PROTON-2772: jiridanek closed pull request #406: PROTON-2772: add format arg annotations for schannel functions URL: https://github.com/apache/qpid-proton/pull/406 > [c] Add parameter safety annotations for printf format strings > -- > > Key: PROTON-2772 > URL: https://issues.apache.org/jira/browse/PROTON-2772 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-c >Affects Versions: proton-c-0.39.0 >Reporter: Jiri Daněk >Assignee: Jiri Daněk >Priority: Major > Fix For: proton-c-0.40.0 > > > There seem to be various mismatched printf format arguments. This is best > resolved by annotating the string format parameters so that regular > compilation warns on the mismatches as they happen. > Proton already has some of this, but it is incomplete. > {noformat} > ``` > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c: In function > ‘pni_logger_log_raw’: > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c:204:41: error: format > ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type > ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=] > 204 | pn_fixed_string_addf(, "%04x/%04x: ", i, size); > | ~~~^ > | || > | |size_t {aka long > unsigned int} > | unsigned int > | %04lx > cc1: all warnings being treated as errors > ``` > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (PROTON-2772) [c] Add parameter safety annotations for printf format strings
[ https://issues.apache.org/jira/browse/PROTON-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17775222#comment-17775222 ] ASF GitHub Bot commented on PROTON-2772: jiridanek opened a new pull request, #406: URL: https://github.com/apache/qpid-proton/pull/406 What's missing is a compilation failure when any warnings are emitted. MSVC needs `/analyze` to report the problems, there is actually lots of diagnostics printed then, and the mismatched format args are not causing compilation to fail so the warnings are easy to miss. > [c] Add parameter safety annotations for printf format strings > -- > > Key: PROTON-2772 > URL: https://issues.apache.org/jira/browse/PROTON-2772 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-c >Affects Versions: proton-c-0.39.0 >Reporter: Jiri Daněk >Assignee: Jiri Daněk >Priority: Major > Fix For: proton-c-0.40.0 > > > There seem to be various mismatched printf format arguments. This is best > resolved by annotating the string format parameters so that regular > compilation warns on the mismatches as they happen. > Proton already has some of this, but it is incomplete. > {noformat} > ``` > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c: In function > ‘pni_logger_log_raw’: > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c:204:41: error: format > ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type > ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=] > 204 | pn_fixed_string_addf(, "%04x/%04x: ", i, size); > | ~~~^ > | || > | |size_t {aka long > unsigned int} > | unsigned int > | %04lx > cc1: all warnings being treated as errors > ``` > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (PROTON-2772) [c] Add parameter safety annotations for printf format strings
[ https://issues.apache.org/jira/browse/PROTON-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17775219#comment-17775219 ] ASF subversion and git services commented on PROTON-2772: - Commit 077ea99536c82f918cb90f662001a15efa1208c8 in qpid-proton's branch refs/heads/main from Jiri Daněk [ https://gitbox.apache.org/repos/asf?p=qpid-proton.git;h=077ea9953 ] PROTON-2772: add parameter safety annotations for printf format strings > [c] Add parameter safety annotations for printf format strings > -- > > Key: PROTON-2772 > URL: https://issues.apache.org/jira/browse/PROTON-2772 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-c >Affects Versions: proton-c-0.39.0 >Reporter: Jiri Daněk >Assignee: Jiri Daněk >Priority: Major > Fix For: proton-c-0.40.0 > > > There seem to be various mismatched printf format arguments. This is best > resolved by annotating the string format parameters so that regular > compilation warns on the mismatches as they happen. > Proton already has some of this, but it is incomplete. > {noformat} > ``` > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c: In function > ‘pni_logger_log_raw’: > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c:204:41: error: format > ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type > ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=] > 204 | pn_fixed_string_addf(, "%04x/%04x: ", i, size); > | ~~~^ > | || > | |size_t {aka long > unsigned int} > | unsigned int > | %04lx > cc1: all warnings being treated as errors > ``` > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (PROTON-2772) [c] Add parameter safety annotations for printf format strings
[ https://issues.apache.org/jira/browse/PROTON-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17775207#comment-17775207 ] ASF GitHub Bot commented on PROTON-2772: jiridanek closed pull request #405: PROTON-2772: add parameter safety annotations for printf format strings URL: https://github.com/apache/qpid-proton/pull/405 > [c] Add parameter safety annotations for printf format strings > -- > > Key: PROTON-2772 > URL: https://issues.apache.org/jira/browse/PROTON-2772 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-c >Affects Versions: proton-c-0.39.0 >Reporter: Jiri Daněk >Assignee: Jiri Daněk >Priority: Major > Fix For: proton-c-0.40.0 > > > There seem to be various mismatched printf format arguments. This is best > resolved by annotating the string format parameters so that regular > compilation warns on the mismatches as they happen. > Proton already has some of this, but it is incomplete. > {noformat} > ``` > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c: In function > ‘pni_logger_log_raw’: > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c:204:41: error: format > ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type > ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=] > 204 | pn_fixed_string_addf(, "%04x/%04x: ", i, size); > | ~~~^ > | || > | |size_t {aka long > unsigned int} > | unsigned int > | %04lx > cc1: all warnings being treated as errors > ``` > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (PROTON-2772) [c] Add parameter safety annotations for printf format strings
[ https://issues.apache.org/jira/browse/PROTON-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17775206#comment-17775206 ] ASF GitHub Bot commented on PROTON-2772: jiridanek commented on PR #405: URL: https://github.com/apache/qpid-proton/pull/405#issuecomment-1762857402 Duplicate of * https://github.com/apache/qpid-proton/pull/397 > [c] Add parameter safety annotations for printf format strings > -- > > Key: PROTON-2772 > URL: https://issues.apache.org/jira/browse/PROTON-2772 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-c >Affects Versions: proton-c-0.39.0 >Reporter: Jiri Daněk >Assignee: Jiri Daněk >Priority: Major > Fix For: proton-c-0.40.0 > > > There seem to be various mismatched printf format arguments. This is best > resolved by annotating the string format parameters so that regular > compilation warns on the mismatches as they happen. > Proton already has some of this, but it is incomplete. > {noformat} > ``` > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c: In function > ‘pni_logger_log_raw’: > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c:204:41: error: format > ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type > ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=] > 204 | pn_fixed_string_addf(, "%04x/%04x: ", i, size); > | ~~~^ > | || > | |size_t {aka long > unsigned int} > | unsigned int > | %04lx > cc1: all warnings being treated as errors > ``` > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (PROTON-2772) [c] Add parameter safety annotations for printf format strings
[ https://issues.apache.org/jira/browse/PROTON-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17775203#comment-17775203 ] ASF GitHub Bot commented on PROTON-2772: jiridanek opened a new pull request, #405: URL: https://github.com/apache/qpid-proton/pull/405 (the commits with fixes are meant to be squashed with the rest, which I plan to do in GitHub webui) > [c] Add parameter safety annotations for printf format strings > -- > > Key: PROTON-2772 > URL: https://issues.apache.org/jira/browse/PROTON-2772 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-c >Affects Versions: proton-c-0.39.0 >Reporter: Jiri Daněk >Assignee: Jiri Daněk >Priority: Major > Fix For: proton-c-0.40.0 > > > There seem to be various mismatched printf format arguments. This is best > resolved by annotating the string format parameters so that regular > compilation warns on the mismatches as they happen. > Proton already has some of this, but it is incomplete. > {noformat} > ``` > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c: In function > ‘pni_logger_log_raw’: > /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c:204:41: error: format > ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type > ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=] > 204 | pn_fixed_string_addf(, "%04x/%04x: ", i, size); > | ~~~^ > | || > | |size_t {aka long > unsigned int} > | unsigned int > | %04lx > cc1: all warnings being treated as errors > ``` > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org