From owner-freebsd-ports-bugs@freebsd.org Sun May 7 19:43:53 2017 Return-Path: Delivered-To: freebsd-ports-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CE9FD62FF1 for ; Sun, 7 May 2017 19:43:53 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A18A195C for ; Sun, 7 May 2017 19:43:53 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id v47Jhqjp059556 for ; Sun, 7 May 2017 19:43:53 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-ports-bugs@FreeBSD.org Subject: [Bug 219126] devel/gdb: Add upstream commits to get rid of min/max macros, improving C++ compatibility Date: Sun, 07 May 2017 19:43:52 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: dim@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-ports-bugs@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter cc flagtypes.name attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 May 2017 19:43:53 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D219126 Bug ID: 219126 Summary: devel/gdb: Add upstream commits to get rid of min/max macros, improving C++ compatibility Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: Individual Port(s) Assignee: freebsd-ports-bugs@FreeBSD.org Reporter: dim@FreeBSD.org CC: luca.pizzamiglio@gmail.com CC: luca.pizzamiglio@gmail.com Flags: maintainer-feedback?(luca.pizzamiglio@gmail.com) Created attachment 182374 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D182374&action= =3Dedit Fix min/max macro usage in devel/gdb I have been experimenting with a newer version of libc++ in the projects/clang500-import branch, and it turns out that gdb has traditionally defined their own min/max macros. However, it compiles most of its .c file= s as C++, and min/max macros are not compatible with C++. Due to a slightly different include order in newer versions of libc++, this= now even leads to compilation errors like the following: In file included from doublest.c:30: In file included from build-gnulib/import/math.h:27: In file included from /usr/include/c++/v1/math.h:310: In file included from /usr/include/c++/v1/limits:112: /usr/include/c++/v1/__undef_min_max:17:2: warning: : macro min is incompati= ble with C++. #undefing min [-W#warnings] #warning: macro min is incompatible with C++. #undefing min ^ /usr/include/c++/v1/__undef_min_max:29:2: warning: : macro max is incompati= ble with C++. #undefing max [-W#warnings] #warning: macro max is incompatible with C++. #undefing max ^ c++: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated] doublest.c:258:19: error: use of undeclared identifier 'min'; did you mean 'fmin'? mant_bits =3D min (mant_bits_left, 32); ^~~ fmin /usr/include/c++/v1/math.h:1221:1: note: 'fmin' declared here fmin(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT ^ doublest.c:568:19: error: use of undeclared identifier 'min'; did you mean 'fmin'? mant_bits =3D min (mant_bits_left, 32); ^~~ fmin /usr/include/c++/v1/math.h:1221:1: note: 'fmin' declared here fmin(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT ^ doublest.c:912:25: error: use of undeclared identifier 'min'; did you mean 'fmin'? memcpy (to, from, min (TYPE_LENGTH (from_type), TYPE_LENGTH (to_type)= )); ^~~ fmin /usr/include/c++/v1/math.h:1221:1: note: 'fmin' declared here fmin(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT ^ 2 warnings and 3 errors generated. Upstream has also seen this problem with newer versions of GNU libstdc++, s= o it made the following two commits: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;a=3Dcommit;h=3D3= 25fac504a327de9c46a4e5cf9c88ece9d9d7701 ("gdb: Use std::min and std::max throughout") https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;a=3Dcommit;h=3D7= 68adc05c44c7e8b5c0f9ca5ad3ca96657715293 ("gdb: Fix std::{min, max}-related build breakage on 32-bit hosts") Here is a patch to add these two commits to our devel/gdb port. I hope they will no longer be necessary when a new gdb version is released. --=20 You are receiving this mail because: You are the assignee for the bug.=