You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Adar Dembo (Code Review)" <ge...@cloudera.org> on 2018/05/16 21:21:32 UTC

[kudu-CR] KUDU-2427: only add -fno-sized-deallocation for C++ files

Hello Todd Lipcon,

I'd like you to do a code review. Please visit

    http://gerrit.cloudera.org:8080/10430

to review the following change.


Change subject: KUDU-2427: only add -fno-sized-deallocation for C++ files
......................................................................

KUDU-2427: only add -fno-sized-deallocation for C++ files

Ubuntu 18.04 has a gcc that's new enough to support -fsized-deallocation.
But, if -fno-sized-deallocation is added to a C file's compilation flags,
the compiler will emit a warning:

  cc1: warning: command line option ‘-fno-sized-deallocation’ is valid for C++/ObjC++ but not for C

The problem is that we want to apply this flag only to "exported" targets,
but we have one such target (gutil_exported) that has both C and C++ files
in it. To address this, we can use a cmake generator expression[1] to
conditionally add the flag only to the C++ files in the target. This means
adding the flag with target_compile_options(), as set_target_properties()
does not support generator expressions.

1. https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html

Change-Id: Ib2fbd94f19495eb48119d8f9ecb6fdceee2387c3
---
M CMakeLists.txt
1 file changed, 3 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/30/10430/1
-- 
To view, visit http://gerrit.cloudera.org:8080/10430
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib2fbd94f19495eb48119d8f9ecb6fdceee2387c3
Gerrit-Change-Number: 10430
Gerrit-PatchSet: 1
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>

[kudu-CR] KUDU-2427: only add -fno-sized-deallocation for C++ files

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has removed Kudu Jenkins from this change.  ( http://gerrit.cloudera.org:8080/10430 )

Change subject: KUDU-2427: only add -fno-sized-deallocation for C++ files
......................................................................


Removed reviewer Kudu Jenkins with the following votes:

* Verified-1 by Kudu Jenkins (120)
-- 
To view, visit http://gerrit.cloudera.org:8080/10430
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: deleteReviewer
Gerrit-Change-Id: Ib2fbd94f19495eb48119d8f9ecb6fdceee2387c3
Gerrit-Change-Number: 10430
Gerrit-PatchSet: 3
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>

[kudu-CR] KUDU-2427: only add -fno-sized-deallocation for C++ files

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/10430 )

Change subject: KUDU-2427: only add -fno-sized-deallocation for C++ files
......................................................................


Patch Set 3: Verified+1

NTP failures across the board.


-- 
To view, visit http://gerrit.cloudera.org:8080/10430
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib2fbd94f19495eb48119d8f9ecb6fdceee2387c3
Gerrit-Change-Number: 10430
Gerrit-PatchSet: 3
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Comment-Date: Thu, 17 May 2018 18:07:05 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-2427: only add -fno-sized-deallocation for C++ files

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/10430 )

Change subject: KUDU-2427: only add -fno-sized-deallocation for C++ files
......................................................................

KUDU-2427: only add -fno-sized-deallocation for C++ files

Ubuntu 18.04 has a gcc that's new enough to support -fsized-deallocation.
But, if -fno-sized-deallocation is added to a C file's compilation flags,
the compiler will emit a warning:

  cc1: warning: command line option ‘-fno-sized-deallocation’ is valid for C++/ObjC++ but not for C

The problem is that we want to apply this flag only to "exported" targets,
but we have one such target (gutil_exported) that has both C and C++ files
in it. To address this, we can use a cmake generator expression[1] to
conditionally add the flag only to the C++ files in the target. This means
adding the flag with target_compile_options(), as set_target_properties()
does not support generator expressions.

1. https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html

Change-Id: Ib2fbd94f19495eb48119d8f9ecb6fdceee2387c3
Reviewed-on: http://gerrit.cloudera.org:8080/10430
Reviewed-by: Todd Lipcon <to...@apache.org>
Tested-by: Adar Dembo <ad...@cloudera.com>
---
M CMakeLists.txt
1 file changed, 3 insertions(+), 1 deletion(-)

Approvals:
  Todd Lipcon: Looks good to me, approved
  Adar Dembo: Verified

-- 
To view, visit http://gerrit.cloudera.org:8080/10430
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib2fbd94f19495eb48119d8f9ecb6fdceee2387c3
Gerrit-Change-Number: 10430
Gerrit-PatchSet: 4
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>

[kudu-CR] KUDU-2427: only add -fno-sized-deallocation for C++ files

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has posted comments on this change. ( http://gerrit.cloudera.org:8080/10430 )

Change subject: KUDU-2427: only add -fno-sized-deallocation for C++ files
......................................................................


Patch Set 3: Code-Review+2


-- 
To view, visit http://gerrit.cloudera.org:8080/10430
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib2fbd94f19495eb48119d8f9ecb6fdceee2387c3
Gerrit-Change-Number: 10430
Gerrit-PatchSet: 3
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Comment-Date: Thu, 17 May 2018 17:48:09 +0000
Gerrit-HasComments: No