From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13796 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "jounijl@yahoo.co.uk" Newsgroups: gmane.linux.lib.musl.general Subject: "Arithmetic exception" with modulus operator '%' Date: Fri, 15 Feb 2019 03:35:23 +0000 Message-ID: Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="211360"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 To: musl@lists.openwall.com Original-X-From: musl-return-13812-gllmg-musl=m.gmane.org@lists.openwall.com Fri Feb 15 00:49:25 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1guQkt-000sqi-Gw for gllmg-musl@m.gmane.org; Fri, 15 Feb 2019 00:49:23 +0100 Original-Received: (qmail 7915 invoked by uid 550); 14 Feb 2019 23:49:21 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 7884 invoked from network); 14 Feb 2019 23:49:20 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1550188148; bh=HTgbhvK2jOil9DgDOCG7wUSWssLjYbbWCHYSDgPkxps=; h=To:From:Subject:Date:From:Subject; b=BCMRr5RC/lTM0L5rseJACGSM/LwEMsdX4UD46MRkCZ5EWuU1j8wltbm8X6LpCXSSE69/I4JEvpjyB7XnmJSPKzcHycdbRogS3vVNb5eFZOm9euG5tjihpUspHXbWcVRbylbyTo1uVRHcr6B00zYuOEF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: news.gmane.org gmane.linux.lib.musl.general:13796 Archived-At: As in the headline. Program stops and prints "Arithmetic exception" at the line where the modulus operator '%' is. I'm compiling in Alpine linux with clang installed from apk:s: clang -c test.c clang -o test test.o The code is: ----- snip -----         unsigned int unum  = 0;         unsigned int umod  = 0;         unsigned int ures  = 0;         ures = unum % umod; // <-- this one ----- /snip ----- The variables have some values other than 0. The environment is: The Alpine Linux is installed in Oracle Virtualbox in FreeBSD 12, 64-bit Intel. $ uname -a Linux localhost 4.14.89-0-vanilla #1-Alpine SMP Tue Dec 18 16:10:10 UTC 2018 x86_64 GNU/Linux $ clang --version Alpine clang version 5.0.1 (tags/RELEASE_501/final) (based on LLVM 5.0.1) What does this? Do I need to include some library? w.b.reg., Jouni