From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/2350 Path: news.gmane.org!.POSTED!not-for-mail From: Guillermo Newsgroups: gmane.comp.sysutils.supervision.general Subject: G++ warnings for set-control-group-knob from nosh-1.37 Date: Sun, 11 Mar 2018 12:06:01 -0300 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1520780643 17022 195.159.176.226 (11 Mar 2018 15:04:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Mar 2018 15:04:03 +0000 (UTC) To: supervision@list.skarnet.org Original-X-From: supervision-return-1941-gcsg-supervision=m.gmane.org@list.skarnet.org Sun Mar 11 16:03:59 2018 Return-path: Envelope-to: gcsg-supervision@m.gmane.org Original-Received: from alyss.skarnet.org ([95.142.172.232]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1ev2Vy-0004HP-I3 for gcsg-supervision@m.gmane.org; Sun, 11 Mar 2018 16:03:58 +0100 Original-Received: (qmail 23708 invoked by uid 89); 11 Mar 2018 15:06:30 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm Original-Sender: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 23701 invoked from network); 11 Mar 2018 15:06:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=wTqwhWrlQWX21uva1Dq9fXGmWQ5X/i8JWCm6AnlYZkI=; b=DUY8UdS+Bh3BCvjnclKizhr6pDGdyPF58TY57I/+gnN+epWFSBgUqconxnymw0oTTA d+Y+aC2Q7nTrW61ctOwllURLw4j8tCVz3+yoXZqbwoBIpkintdV8Wc9/vDaxpPYWNiP/ /72WuPjP81FbGSb5Auiar98znGdDWwrN03ngsXDmr90IB1ZYP+wfn+Nm3FVGucXYbvtU Mjss4Xo+BVzueQUIVjey98wqMNydlJ5iQPiCRClyTYzFAbiNx8P0cPAh60BQd1tBVuMd P+a+kAkeTgwkMKS4rZ7YzlsE6j4cX2qXEpuPNrPpeTkPnF4FfrPcc4Vmhgd/YR4D07/q gC6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=wTqwhWrlQWX21uva1Dq9fXGmWQ5X/i8JWCm6AnlYZkI=; b=ETik4Pvug5JpM0daZaOcksgXKMMTD+ZwKebtEOsnq/g/LmCF5qpdc8jRGg4ZXyiEa2 tNmfvnEEiVaMVtru51kY0uRHVG2OnOTZ6eb+Q655lZML/GkZP6WpmFZMnxHMgCQttawX 9MWVb5e0ZtR7OMwKsfNVViN1mU0/ugFWEoc6ruM8OMqynrhLth+0rQfBgevy6DZ/ywWA VrXrZuLgPuW5bwNyGwofL43hxBW+Ra4QvReMIb7obHzZiGT20o6QBgslHdpyuD/m8EKQ 3PSpLSCbl7/N+8LqkShZ3cFLaUNY9epSnz7tJRpduT7D0hVIXBTEZyBhmMDvFDWKNwqf 1tKw== X-Gm-Message-State: AElRT7GbzxTGm0D0u0RqswFGS8tRGlvizL6s48YXcYTYsuXKIXH5D1nd ninIYuPAMLbg2dJfwSXgOGIV/b3FfQM0hlimm/k= X-Google-Smtp-Source: AG47ELvcK1DIDg6cOMVwr0fS4X9AmvGGFX5KGsCqtksUVzK3Dny5TiFkinsPEuJ6AJ2NNr/0D7Ok3m4aDC8eneMlZd8= X-Received: by 10.107.187.65 with SMTP id l62mr5774473iof.1.1520780761640; Sun, 11 Mar 2018 08:06:01 -0700 (PDT) Xref: news.gmane.org gmane.comp.sysutils.supervision.general:2350 Archived-At: Hello, 1) G++ says: set-control-group-knob.cpp: In function 'void set_control_group_knob(const char*&, std::vector&, ProcessEnvironment&)': set-control-group-knob.cpp:179:5: warning: 'hundred' may be used uninitialized in this function [-Wmaybe-uninitialized] if (hundred > std::numeric_limits::max() / 100U) ^~ The only reference to 'hundred' after its definition is the call 'read_first_line_number (percent_of, hundred)', where 'percent_of' holds the filename passed to set-control-group-knob(1) via its --percent-of option. read_first_line_number() is defined as this set of overloaded functions: bool read_first_line_number (std::istream & i, uint_least64_t v); bool read_first_line_number (const char * filename, uint_least64_t & v); The second one is basically a wrapper for the first one. Looking at the code, shouldn't the 'v' parameter of the first one also have a reference type? 2) G++ also says: set-control-group-knob.cpp:153:13: warning: In the GNU C Library, "major" is defined by . For historical compatibility, it is currently defined by as well, but we plan to remove this soon. To use "major", include directly. If you did not intend to use a system-defined macro "major", you should undefine it after including . set-control-group-knob.cpp:153:13: warning: In the GNU C Library, "minor" is defined by . For historical compatibility, it is currently defined by as well, but we plan to remove this soon. To use "minor", include directly. If you did not intend to use a system-defined macro "minor", you should undefine it after including . This warning is present for GNU libc >= 2.25, so may I suggest adding the following to source/set-control-group-knob.cpp? #if defined(__LINUX__) || defined(__linux__) #include #endif I believe this should work even for Debian jessie's GNU libc 2.19. Thanks, G.