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 [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 77678387088D for ; Thu, 22 Jul 2021 07:55:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 77678387088D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626940515; 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=nLb/rISAOBnvtxmXHiezzGPiHZRqg7G4FfCIJeD7qEg=; b=fhsZLiZaE0h0/nQ0L5abGbe+W8AaYOdv6BGIRThcGz6+9eQ6+VSsWLTgRncl6FvjPSetv6 YOXNyqQzmpP/DTwulYvW9Msf3+lDg2pf+8lsGS8RwAnieGxb1IRmI7pwR5ZDsqSpqYUWxE wbzEeMAz6CUmVVj1IRSfL9E3UeLbq4I= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-585-Jr6Lz1OwPKKWD-Xgh4WrZg-1; Thu, 22 Jul 2021 03:55:13 -0400 X-MC-Unique: Jr6Lz1OwPKKWD-Xgh4WrZg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A22FF800D55; Thu, 22 Jul 2021 07:55:12 +0000 (UTC) Received: from calimero.vinschen.de (ovpn-113-186.ams2.redhat.com [10.36.113.186]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 72C3B5C1BB; Thu, 22 Jul 2021 07:55:12 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id 07757A80D50; Thu, 22 Jul 2021 09:55:11 +0200 (CEST) Date: Thu, 22 Jul 2021 09:55:11 +0200 From: Corinna Vinschen To: Matthew Joyce Cc: Newlib , Joel Sherrill Subject: Re: [PATCH 1/1] libc: Added implementations and prototypes for Message-ID: Reply-To: newlib@sourceware.org Mail-Followup-To: Matthew Joyce , Newlib , Joel Sherrill References: <20210717101038.3283-1-mfjoyce2004@gmail.com> <20210717101038.3283-2-mfjoyce2004@gmail.com> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=vinschen@redhat.com 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=-7.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 07:55:16 -0000 Hi Matt, On Jul 22 07:14, Matthew Joyce wrote: > Hi Corinna, > > I've made the changes you recommended but I'm running into a problem > with the definition of SIG2STR_MAX. You suggested: > > #if __STDINT_EXP(INT_MAX) > 0x7fff > #define SIG2STR_MAX (sizeof ("RTMAX+") + sizeof ("4294967295") - 1) > #else #define SIG2STR_MAX (sizeof ("RTMAX+") + sizeof ("65535") - 1) These are actually two lines, right? It's just a copy/paste glitch, I guess. > #endif > > I've tried it both in newlib and natively but I get the error: > " missing binary operator before token '(' " > (In the first line of the block) I hacked a STC: ---------------------------------- #include #include #include #if __STDINT_EXP(INT_MAX) > 0x7fff #define SIG2STR_MAX (sizeof ("RTMAX+") + sizeof ("4294967295") - 1) #else #define SIG2STR_MAX (sizeof ("RTMAX+") + sizeof ("65535") - 1) #endif void foo (int sig, char *out) { char buf[SIG2STR_MAX]; if (sig > SIG2STR_MAX) return; snprintf (buf, SIG2STR_MAX, "FOO+%d", sig); memcpy (out, buf, SIG2STR_MAX); } ---------------------------------- $ gcc -g -O2 -c -Wall foo.c No error or warning is generated, so I'm puzzled about your problem. Would you mind to paste the affected code snippet and the full gcc error output? Corinna