# Arm64/ppc64le segfaults

**URL:** <https://travis-ci.community/t/arm64-ppc64le-segfaults/6158>\
**Category:** Multi CPU Architecture\
**Tags:** bug\
**Created:** [November 27, 2019, 2:59am UTC](https://travis-ci.community/t/arm64-ppc64le-segfaults/6158 "2019-11-27T02:59:24Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![noloader](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/noloader/32/2971_2.png) [@noloader](https://travis-ci.community/u/noloader)\
**Post date:** [December 13, 2019, 12:02pm UTC](https://travis-ci.community/t/arm64-ppc64le-segfaults/6158/3 "2019-12-13T12:02:31Z")

</div>

I _think_ your program has undefined behavior:

```auto
int main(int argc, char *argv[])
{
	int c = 'z';
	c = getc(stdin);

	if (c == EOF)
		printf("EOF!\n");
	else
		printf("got '%c' (0x%x)\n", c, c);

	return 0;
}

```

The first `c` should probably use `%d`, not `%c`, since `c` is an `int`. Maybe something like:

```auto
printf("got '%d' (0x%x)\n", c, c);

```

Use `g++ -Wall` or a Sanitizer to vet the code at compile time.

---

_[View the full topic](https://travis-ci.community/t/arm64-ppc64le-segfaults/6158)._
