From patchwork Mon Oct 1 21:27:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 147933 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp4391731lji; Mon, 1 Oct 2018 14:27:58 -0700 (PDT) X-Google-Smtp-Source: ACcGV61WH/dYBCXad95T3rCA8J3/pd38Cv8+eCxQo2dkK8B7qXAR7jhbsYbllpmf3iy8sqMuqdmp X-Received: by 2002:a62:3644:: with SMTP id d65-v6mr13144132pfa.133.1538429278724; Mon, 01 Oct 2018 14:27:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538429278; cv=none; d=google.com; s=arc-20160816; b=PmBnqI4cjKpTXMZa0zZKZNltj90nVNN9ZevFdj4z3cBxpYclEmXMrMhi7aWNq4Gm86 JqN5QVGscBUGZcROc/VFZr0cEiNI0+85GlKPAqRjdbhBQzdsPEfaM5GEoJOn4l3UfW6O cxfNQ2ZtcPh+a5J1y+J6TSnA3ogEnnD1fuiB0SfZo1X6xuEyzgUo2N+wHrt2Im4nKOta gDAOEvkmMfs3vlcuIFZYvvbj3uIc0TEmJNagi1bP9D/wh7nBvw9rGZO48nacNdpjgefY ysNqAzNxyHSRG+0cxU9008PPG3Ono3MXeqstBA4niGd82UaeaXHTNi0dop1mhaqo+wYd wMAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:mime-version:dkim-signature :delivered-to:sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=RGnePbgMmYUcOGhSFRLDkHXL0UgaOhYBgHAkYMvjg8M=; b=xD5y/Hv7OqsCEwjZuGPXkI3amhHklvrIwi4KpyiKJgZL5NLW8/GhAeKP5ZA1hoFzEm gBRkS5nXuinID6fnfSwXfK6m/xAWi7B2bhY+Jt0+kFmyWjDBfvPKtIhoJo3S8u9A5kg9 Kb9z58DNGgzSCg4adR/Gyfc5dowGwU2kQ5DeIUaU7Ktg124HkxuXau1kTEt/6JcYaZIy z8JeeqgKWxD94iRidLt4DUliYrsxCy6Cxy23QJITrRzZeSzex0K1c/3UHTqC7xvd3mYz uW6tXtpRhwORDqaSA9ZGK+EXCFsD/bHT2KmZdcl/uc+4gia8eiJA4gji8e4naaFWfus8 SWDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=r7k6zXER; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=a6wG5Cjb; spf=pass (google.com: domain of newlib-return-16502-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="newlib-return-16502-patch=linaro.org@sourceware.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id p6-v6si13420005pfh.266.2018.10.01.14.27.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Oct 2018 14:27:58 -0700 (PDT) Received-SPF: pass (google.com: domain of newlib-return-16502-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=r7k6zXER; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=a6wG5Cjb; spf=pass (google.com: domain of newlib-return-16502-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="newlib-return-16502-patch=linaro.org@sourceware.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:from:date:message-id:subject:to :content-type; q=dns; s=default; b=x3jqCuyLItO8QKS5syFwAoEdd5Tgz DTIw7d1HQZbQapiQ4cSdsbx+xEOlPX7veCWm9soLtYGAZgb8R4gTT9zMY+Xmo9f6 YIsolIJSWSzv5jlW2Fd9ugp3/MI5r2uva58QJqumU1/VFUQ+JWJrAIUWsT7e+nMh h0wRAZCNAhVPmw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:from:date:message-id:subject:to :content-type; s=default; bh=NNK0BGCppIW1oPg2Vtvo2vSTofc=; b=r7k 6zXER0qTAIFkQWpqeVd3W3c7SGbBLtgiQPOMtKoqn4/Oof08Bq2CCjgN57hXmvFH joGamPJi5W64Ot+vuW/5nudKenZ7wSpiSqFu1YBarsGMGQmM5XV5RpQ+HHOzSkcg i7ZSbITKxFyEydzE7eTcEoggdkAa38mkGgC93JbQ= Received: (qmail 1380 invoked by alias); 1 Oct 2018 21:27:50 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Delivered-To: mailing list newlib@sourceware.org Received: (qmail 1359 invoked by uid 89); 1 Oct 2018 21:27:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1424, H*r:sk:newlib@ X-HELO: mail-vs1-f47.google.com Received: from mail-vs1-f47.google.com (HELO mail-vs1-f47.google.com) (209.85.217.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 01 Oct 2018 21:27:48 +0000 Received: by mail-vs1-f47.google.com with SMTP id e206so2263388vsd.0 for ; Mon, 01 Oct 2018 14:27:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:from:date:message-id:subject:to; bh=KRJb1FPRN5nDY0E+fptiVGvxykOZnDCB7xAWwVBSQFM=; b=a6wG5CjbKqvoa/aT5bVjnVPBFRHzYcbubB1BAlSvarIw7JqUFml/DGX5JAusCMlwKk 1zdpPoQP8U6JHNf3v7gYvqAUAwQxCdTxV5bZGyl8XssD+J3aUXkRJlKT3DMZiXrVlFIv Y1Wr9w8bsiY7HxWzmOZPHAeEaL+vkbss3Zf3U= MIME-Version: 1.0 From: Christophe Lyon Date: Mon, 1 Oct 2018 23:27:34 +0200 Message-ID: Subject: [ARM] Add endless loop to avoid a compiler warning on noreturn functions. To: newlib@sourceware.org X-IsSubscribed: yes Hi, While building newlib for ARM, I noticed GCC warnings for _exit() that the compiler thinks they return a value despite being noreturn. Like other targets, this small adds an endless loop to avoid the warning. OK? Christophe commit 72ab15cd60be82262be4b0bdb79aa78376724c8c Author: Christophe Lyon Date: Mon Oct 1 15:52:42 2018 +0000 [ARM] Add endless loop to avoid a compiler warning on noreturn functions. 2018-10-01 Christophe Lyon * libgloss/arm/_exit.c (_exit): Add endless loop. * newlib/libc/sys/arm/syscalls.c (_exit): Likewise. diff --git a/libgloss/arm/_exit.c b/libgloss/arm/_exit.c index ca2d21c..90220d2 100644 --- a/libgloss/arm/_exit.c +++ b/libgloss/arm/_exit.c @@ -12,4 +12,8 @@ _exit (int status) Note: The RDI implementation of _kill throws away both its arguments. */ _kill (status, -1); + + /* Convince GCC that this function never returns. */ + for (;;) + ; } diff --git a/newlib/libc/sys/arm/syscalls.c b/newlib/libc/sys/arm/syscalls.c index 6e70467..311b28d 100644 --- a/newlib/libc/sys/arm/syscalls.c +++ b/newlib/libc/sys/arm/syscalls.c @@ -452,6 +452,10 @@ _exit (int status) Note: The RDI implementation of _kill throws away both its arguments. */ _kill(status, -1); + + /* Convince GCC that this function never returns. */ + for (;;) + ; } pid_t