You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Alexey Serbin (Code Review)" <ge...@cloudera.org> on 2025/09/02 21:00:07 UTC
[kudu-CR] [build] detect undefined but evaluated macros
Alexey Serbin has uploaded this change for review. ( http://gerrit.cloudera.org:8080/23367
Change subject: [build] detect undefined but evaluated macros
......................................................................
[build] detect undefined but evaluated macros
Undefined macros that are used in pre-processor expressions might lead
to a confusion and unexpected results. One recent example of that
was [1] where in PS6 the OPENSSL_VERSION_NUMBER macro was not defined
and silently evaluated to 0 in webserver_options.cc. The issue was
mitigated by including the necessary header file in PS7.
With this update, both GCC and CLANG exit with an error if there is
a non-defined, but evaluated macro in the code. I verified it worked
as expected with the described issue in [1] as of PS6. Also, a few
updates were necessary to the already existing code to compile the code
without an error once the guard against such conditions was enabled.
Where necessary, I silenced the corresponding warning since it was
mostly the code imported into Kudu from other projects.
[1] https://gerrit.cloudera.org/#/c/23295
Change-Id: I9f60f08b41c675a2a7307664a2ef0c7ecf8d682e
---
M CMakeLists.txt
M src/kudu/codegen/module_builder.cc
M src/kudu/gutil/CMakeLists.txt
M src/kudu/util/debug/trace_event.h
M thirdparty/download-thirdparty.sh
A thirdparty/patches/protobuf-inlined_string_field.patch
6 files changed, 21 insertions(+), 4 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/67/23367/1
--
To view, visit http://gerrit.cloudera.org:8080/23367
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9f60f08b41c675a2a7307664a2ef0c7ecf8d682e
Gerrit-Change-Number: 23367
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <al...@apache.org>
[kudu-CR] [build] detect undefined but evaluated macros
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/23367 )
Change subject: [build] detect undefined but evaluated macros
......................................................................
Patch Set 1: Verified-1
Build Failed
http://jenkins.kudu.apache.org/job/pre_commit/1743/ : FAILURE
--
To view, visit http://gerrit.cloudera.org:8080/23367
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9f60f08b41c675a2a7307664a2ef0c7ecf8d682e
Gerrit-Change-Number: 23367
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Tue, 02 Sep 2025 21:59:16 +0000
Gerrit-HasComments: No
[kudu-CR] [build] detect undefined but evaluated macros
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/23367 )
Change subject: [build] detect undefined but evaluated macros
......................................................................
[build] detect undefined but evaluated macros
Undefined macros that are used in pre-processor expressions might lead
to a confusion and unexpected results. One recent example of that
was [1] where in PS6 the OPENSSL_VERSION_NUMBER macro was not defined
and silently evaluated to 0 in webserver_options.cc. The issue was
mitigated by including the necessary header file in PS7.
With this update, both GCC and CLANG exit with an error if there is
a non-defined, but evaluated macro in the code. I verified it worked
as expected with the described issue in [1] as of PS6. Also, a few
updates were necessary to the already existing code to compile the code
without an error once the guard against such conditions was enabled.
Where necessary, I silenced the corresponding warning since it was
mostly the code imported into Kudu from other projects.
[1] https://gerrit.cloudera.org/#/c/23295
Change-Id: I9f60f08b41c675a2a7307664a2ef0c7ecf8d682e
Reviewed-on: http://gerrit.cloudera.org:8080/23367
Tested-by: Alexey Serbin <al...@apache.org>
Reviewed-by: Abhishek Chennaka <ac...@cloudera.com>
---
M CMakeLists.txt
M src/kudu/codegen/module_builder.cc
M src/kudu/gutil/CMakeLists.txt
M src/kudu/gutil/ref_counted.h
M src/kudu/util/debug/trace_event.h
M src/kudu/util/thread_restrictions.h
M thirdparty/download-thirdparty.sh
A thirdparty/patches/protobuf-inlined_string_field.patch
8 files changed, 23 insertions(+), 6 deletions(-)
Approvals:
Alexey Serbin: Verified
Abhishek Chennaka: Looks good to me, approved
--
To view, visit http://gerrit.cloudera.org:8080/23367
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I9f60f08b41c675a2a7307664a2ef0c7ecf8d682e
Gerrit-Change-Number: 23367
Gerrit-PatchSet: 4
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
[kudu-CR] [build] detect undefined but evaluated macros
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/23367 )
Change subject: [build] detect undefined but evaluated macros
......................................................................
Patch Set 3: Verified-1
Build Failed
http://jenkins.kudu.apache.org/job/pre_commit/1747/ : FAILURE
--
To view, visit http://gerrit.cloudera.org:8080/23367
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9f60f08b41c675a2a7307664a2ef0c7ecf8d682e
Gerrit-Change-Number: 23367
Gerrit-PatchSet: 3
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 03 Sep 2025 00:55:11 +0000
Gerrit-HasComments: No
[kudu-CR] [build] detect undefined but evaluated macros
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins, Abhishek Chennaka,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/23367
to look at the new patch set (#2).
Change subject: [build] detect undefined but evaluated macros
......................................................................
[build] detect undefined but evaluated macros
Undefined macros that are used in pre-processor expressions might lead
to a confusion and unexpected results. One recent example of that
was [1] where in PS6 the OPENSSL_VERSION_NUMBER macro was not defined
and silently evaluated to 0 in webserver_options.cc. The issue was
mitigated by including the necessary header file in PS7.
With this update, both GCC and CLANG exit with an error if there is
a non-defined, but evaluated macro in the code. I verified it worked
as expected with the described issue in [1] as of PS6. Also, a few
updates were necessary to the already existing code to compile the code
without an error once the guard against such conditions was enabled.
Where necessary, I silenced the corresponding warning since it was
mostly the code imported into Kudu from other projects.
[1] https://gerrit.cloudera.org/#/c/23295
Change-Id: I9f60f08b41c675a2a7307664a2ef0c7ecf8d682e
---
M CMakeLists.txt
M src/kudu/codegen/module_builder.cc
M src/kudu/gutil/CMakeLists.txt
M src/kudu/gutil/ref_counted.h
M src/kudu/util/debug/trace_event.h
M thirdparty/download-thirdparty.sh
A thirdparty/patches/protobuf-inlined_string_field.patch
7 files changed, 22 insertions(+), 5 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/67/23367/2
--
To view, visit http://gerrit.cloudera.org:8080/23367
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I9f60f08b41c675a2a7307664a2ef0c7ecf8d682e
Gerrit-Change-Number: 23367
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
[kudu-CR] [build] detect undefined but evaluated macros
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/23367 )
Change subject: [build] detect undefined but evaluated macros
......................................................................
Patch Set 2:
Build Aborted
http://jenkins.kudu.apache.org/job/pre_commit/1744/ : ABORTED
--
To view, visit http://gerrit.cloudera.org:8080/23367
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9f60f08b41c675a2a7307664a2ef0c7ecf8d682e
Gerrit-Change-Number: 23367
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Tue, 02 Sep 2025 22:57:37 +0000
Gerrit-HasComments: No
[kudu-CR] [build] detect undefined but evaluated macros
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has removed a vote on this change.
Change subject: [build] detect undefined but evaluated macros
......................................................................
Removed Verified-1 by Kudu Jenkins (120)
--
To view, visit http://gerrit.cloudera.org:8080/23367
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: deleteVote
Gerrit-Change-Id: I9f60f08b41c675a2a7307664a2ef0c7ecf8d682e
Gerrit-Change-Number: 23367
Gerrit-PatchSet: 3
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
[kudu-CR] [build] detect undefined but evaluated macros
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/23367 )
Change subject: [build] detect undefined but evaluated macros
......................................................................
Patch Set 3:
Build Started http://jenkins.kudu.apache.org/job/pre_commit/1747/
--
To view, visit http://gerrit.cloudera.org:8080/23367
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9f60f08b41c675a2a7307664a2ef0c7ecf8d682e
Gerrit-Change-Number: 23367
Gerrit-PatchSet: 3
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Tue, 02 Sep 2025 22:57:41 +0000
Gerrit-HasComments: No
[kudu-CR] [build] detect undefined but evaluated macros
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/23367 )
Change subject: [build] detect undefined but evaluated macros
......................................................................
Patch Set 3: Verified+1
unrelated Java test failures (TSAN): org.apache.kudu.client.TestKuduClient
--
To view, visit http://gerrit.cloudera.org:8080/23367
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9f60f08b41c675a2a7307664a2ef0c7ecf8d682e
Gerrit-Change-Number: 23367
Gerrit-PatchSet: 3
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 03 Sep 2025 01:12:01 +0000
Gerrit-HasComments: No
[kudu-CR] [build] detect undefined but evaluated macros
Posted by "Abhishek Chennaka (Code Review)" <ge...@cloudera.org>.
Abhishek Chennaka has posted comments on this change. ( http://gerrit.cloudera.org:8080/23367 )
Change subject: [build] detect undefined but evaluated macros
......................................................................
Patch Set 1:
Looks like there are some more macros undefined being caught and failing the build. For example:
In file included from /home/jenkins-slave/workspace/build_and_test/src/kudu/util/metrics.h:250:
/home/jenkins-slave/workspace/build_and_test/src/kudu/gutil/ref_counted.h:274:5: error: 'SCOPED_REFPTR_ALLOW_IMPLICIT_CONVERSION_TO_PTR' is not defined, evaluates to 0 [-Werror,-Wundef]
#if SCOPED_REFPTR_ALLOW_IMPLICIT_CONVERSION_TO_PTR
^
1 error generated.
--
To view, visit http://gerrit.cloudera.org:8080/23367
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9f60f08b41c675a2a7307664a2ef0c7ecf8d682e
Gerrit-Change-Number: 23367
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Tue, 02 Sep 2025 22:01:22 +0000
Gerrit-HasComments: No
[kudu-CR] [build] detect undefined but evaluated macros
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins, Abhishek Chennaka,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/23367
to look at the new patch set (#3).
Change subject: [build] detect undefined but evaluated macros
......................................................................
[build] detect undefined but evaluated macros
Undefined macros that are used in pre-processor expressions might lead
to a confusion and unexpected results. One recent example of that
was [1] where in PS6 the OPENSSL_VERSION_NUMBER macro was not defined
and silently evaluated to 0 in webserver_options.cc. The issue was
mitigated by including the necessary header file in PS7.
With this update, both GCC and CLANG exit with an error if there is
a non-defined, but evaluated macro in the code. I verified it worked
as expected with the described issue in [1] as of PS6. Also, a few
updates were necessary to the already existing code to compile the code
without an error once the guard against such conditions was enabled.
Where necessary, I silenced the corresponding warning since it was
mostly the code imported into Kudu from other projects.
[1] https://gerrit.cloudera.org/#/c/23295
Change-Id: I9f60f08b41c675a2a7307664a2ef0c7ecf8d682e
---
M CMakeLists.txt
M src/kudu/codegen/module_builder.cc
M src/kudu/gutil/CMakeLists.txt
M src/kudu/gutil/ref_counted.h
M src/kudu/util/debug/trace_event.h
M src/kudu/util/thread_restrictions.h
M thirdparty/download-thirdparty.sh
A thirdparty/patches/protobuf-inlined_string_field.patch
8 files changed, 23 insertions(+), 6 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/67/23367/3
--
To view, visit http://gerrit.cloudera.org:8080/23367
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I9f60f08b41c675a2a7307664a2ef0c7ecf8d682e
Gerrit-Change-Number: 23367
Gerrit-PatchSet: 3
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
[kudu-CR] [build] detect undefined but evaluated macros
Posted by "Abhishek Chennaka (Code Review)" <ge...@cloudera.org>.
Abhishek Chennaka has posted comments on this change. ( http://gerrit.cloudera.org:8080/23367 )
Change subject: [build] detect undefined but evaluated macros
......................................................................
Patch Set 3: Code-Review+2
--
To view, visit http://gerrit.cloudera.org:8080/23367
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9f60f08b41c675a2a7307664a2ef0c7ecf8d682e
Gerrit-Change-Number: 23367
Gerrit-PatchSet: 3
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 03 Sep 2025 05:08:11 +0000
Gerrit-HasComments: No
[kudu-CR] [build] detect undefined but evaluated macros
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/23367 )
Change subject: [build] detect undefined but evaluated macros
......................................................................
Patch Set 1:
Build Started http://jenkins.kudu.apache.org/job/pre_commit/1743/
--
To view, visit http://gerrit.cloudera.org:8080/23367
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9f60f08b41c675a2a7307664a2ef0c7ecf8d682e
Gerrit-Change-Number: 23367
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Tue, 02 Sep 2025 21:00:15 +0000
Gerrit-HasComments: No
[kudu-CR] [build] detect undefined but evaluated macros
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/23367 )
Change subject: [build] detect undefined but evaluated macros
......................................................................
Patch Set 1:
> Looks like there are some more macros undefined being caught and
> failing the build. For example:
>
> In file included from /home/jenkins-slave/workspace/build_and_test/src/kudu/util/metrics.h:250:
> /home/jenkins-slave/workspace/build_and_test/src/kudu/gutil/ref_counted.h:274:5:
> error: 'SCOPED_REFPTR_ALLOW_IMPLICIT_CONVERSION_TO_PTR' is not
> defined, evaluates to 0 [-Werror,-Wundef]
> #if SCOPED_REFPTR_ALLOW_IMPLICIT_CONVERSION_TO_PTR
> ^
> 1 error generated.
Right -- that was because I removed one updated in gutil code which I still have in my workspace (so I didn't see any breakages). I assumed the flag in src/kudu/gutil/CMakeLists.txt would take care of that, but the issue is that the code in ref_counted.h is included in many other sub-projects.
I returned it back, so now it should be OK.
--
To view, visit http://gerrit.cloudera.org:8080/23367
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9f60f08b41c675a2a7307664a2ef0c7ecf8d682e
Gerrit-Change-Number: 23367
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Tue, 02 Sep 2025 22:14:50 +0000
Gerrit-HasComments: No
[kudu-CR] [build] detect undefined but evaluated macros
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/23367 )
Change subject: [build] detect undefined but evaluated macros
......................................................................
Patch Set 2:
Build Started http://jenkins.kudu.apache.org/job/pre_commit/1744/
--
To view, visit http://gerrit.cloudera.org:8080/23367
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9f60f08b41c675a2a7307664a2ef0c7ecf8d682e
Gerrit-Change-Number: 23367
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Tue, 02 Sep 2025 22:13:06 +0000
Gerrit-HasComments: No