From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 2FB773858C98 for ; Wed, 15 Nov 2023 13:50:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2FB773858C98 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2FB773858C98 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700056252; cv=none; b=nK/vQaCfKRKziEiX5vnI6o+iqnDaULMJRNOQLLIg4pUiFyL/Hfm618YJdSDwmi+rs13Dw/b9Z4WI3pBN+TQAAq12bQZKxp9Tp0XJpCEzqwvkJtjkj+0oODh1BdxFUDs52TaF6l5tQrhaO6tzue5OddH4/kGgq4RgY8w5cAt8oas= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700056252; c=relaxed/simple; bh=WzaHtm+Ft+29t8YlMv7V5ui6kIVLG6Os5CswikO1UcU=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=gzkdL7FVaccNONlbJvBuFXuZMLk6fPnGXN2r7jHCCVHVF5BmH5z9Kp9mRNlMzJWhv2I0XLoVQ7rM/9JCZKE1Ro4yCEb+yn7vjIThMUtDeYh8tqUmCe3dZtvtEWx+2pu28/nDf86dfnD+Q8JtSbOPxBdOK6x2iPASlrPVuvFiTmQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700056250; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=NxXVtsVtCTp6wYn0qMg1GkAiThKTNpxj+MbujIM7UCQ=; b=LZfllmc8KquCaY0ikWeKR3g9pcqOsQ+lVq4rbnqQdh92BbeleNRnOsvZuvpGMu0VAdk7Lp srRNe3A/kBYixwpaZeyz5q/9/crfnAf6PVr94/f8mT3IP/T1iIpm18Ymrsfm2Y51CO2x1n qRPTLV2Ex+474fAuz0D6gwVAAZBcLFk= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-103--9AeJlnSOgyR-XbSCI_1Vg-1; Wed, 15 Nov 2023 08:50:47 -0500 X-MC-Unique: -9AeJlnSOgyR-XbSCI_1Vg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 452851C060C3; Wed, 15 Nov 2023 13:50:47 +0000 (UTC) Received: from calimero.vinschen.de (unknown [10.39.194.184]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 235C61C060AE; Wed, 15 Nov 2023 13:50:46 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id 95BC6A80BDB; Wed, 15 Nov 2023 14:50:45 +0100 (CET) Date: Wed, 15 Nov 2023 14:50:45 +0100 From: Corinna Vinschen To: Takashi Yano Cc: newlib@sourceware.org Subject: Re: Coverity Scan: Analysis completed for RTEMS-Newlib Message-ID: Reply-To: newlib@sourceware.org Mail-Followup-To: Takashi Yano , newlib@sourceware.org References: <654dcb688da84_69bd52d4ed1e699a037313@prd-scan-dashboard-0.mail> <20231111005515.6e77d27ca9a5dfa3946fde28@nifty.ne.jp> <20231111005930.0e9c21b8ff70b2160413e7a5@nifty.ne.jp> MIME-Version: 1.0 In-Reply-To: <20231111005930.0e9c21b8ff70b2160413e7a5@nifty.ne.jp> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Nov 11 00:59, Takashi Yano wrote: > On Sat, 11 Nov 2023 00:55:15 +0900 > Takashi Yano wrote: > > On Fri, 10 Nov 2023 16:31:44 +0100 > > Corinna Vinschen wrote: > > > On Nov 10 08:50, Joel Sherrill wrote: > > > > Hmmmm.. an email just before the one I forwarded shows 6 new defects were > > > > added in the last commits. They appear to be the same issue I just > > > > forwarded but in different scanf variants. > > > > > > > > CID 423229 (#1 of 1): Uninitialized scalar variable (UNINIT)2. > > > > uninit_use_in_call: Using uninitialized value f._flags2 when calling > > > > __ssvfiscanf_r. [show details > > > > > > > > ] > > > > > > Looks like a false positive. > > > > > > The ORIENT macro will set or reset the value of the _flags2 __SWID bit > > > if the _flags __SORD bit isn't set. It never is set at the start, so > > > the _flags2 __SWID bit is always set. And only then, the ORIENT macro > > > will check the value. > > > > Perhaps, this happens because other bits of _flags2 than __SWID is not > > initialized. > > > > Which is better solution do you think? > > (1) Modify ORIENT macro so that it returns (ori > 0) ? 1 : -1. > > (2) Initialize f._flags2 = 0 in sscanf() family. > > Ah, this problem will also occur for sprintf() family. So it seems that > (1) is easier becase f._file = -1 is set at 41 places. I wonder, though, if setting f._flags2 = 0 isn't all around the better solution. That would mean that ORIENT itself doesn't have to become more complicated, having to check (ori > 0) even in places, where this isn't a problem. Corinna