mailing list of musl libc
 help / color / mirror / code / Atom feed
* "Arithmetic exception" with modulus operator '%'
@ 2019-02-15  3:35 jounijl
  2019-02-14 23:58 ` Rich Felker
  2019-02-15 10:05 ` Szabolcs Nagy
  0 siblings, 2 replies; 5+ messages in thread
From: jounijl @ 2019-02-15  3:35 UTC (permalink / raw)
  To: musl


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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-02-15 17:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-15  3:35 "Arithmetic exception" with modulus operator '%' jounijl
2019-02-14 23:58 ` Rich Felker
2019-02-15 10:31   ` jounijl
2019-02-15 17:21     ` Rich Felker
2019-02-15 10:05 ` Szabolcs Nagy

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).