Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

‘UINT32_MAX’ undeclared problem in Linux #67

Closed
unknowntpo opened this issue Jul 4, 2020 · 1 comment
Closed

‘UINT32_MAX’ undeclared problem in Linux #67

unknowntpo opened this issue Jul 4, 2020 · 1 comment

Comments

@unknowntpo
Copy link
Contributor

Problems: UINT32_MAX’ undeclared problem in Linux

Why I post this issue?

I use make to build the program, and found this problem:

$ make
cc -o kilo kilo.c -Wall -W -pedantic -std=c99
kilo.c: In function ‘editorUpdateRow’:
kilo.c:567:21: error: ‘UINT32_MAX’ undeclared (first use in this function); did you mean ‘__UINT32_MAX__’?
     if (allocsize > UINT32_MAX) {
                     ^~~~~~~~~~
                     __UINT32_MAX__
kilo.c:567:21: note: each undeclared identifier is reported only once for each function it appears in
Makefile:4: recipe for target 'kilo' failed
make: *** [kilo] Error 1

My environment:

$ uname -a
Linux beaglebone 4.9.78-ti-r94 #1 SMP PREEMPT Fri Jan 26 21:26:24 UTC 2018 armv7l GNU/Linux

How I fix it ?

Just include <stdint.h> and the program compiled correctly with no errors.

Test kilo on MacOS

I found no erorr when compiling.
And my environment on MacOS is:

$ uname -a
Darwin unknowntpo.local 19.4.0 Darwin Kernel Version 19.4.0: Wed Mar  4 22:28:40 PST 2020; root:xnu-6153.101.6~15/RELEASE_X86_64 x86_64
@unknowntpo unknowntpo changed the title UINT32_MAX’ undeclared problem in Linux ‘UINT32_MAX’ undeclared problem in Linux Jul 5, 2020
unknowntpo added a commit to unknowntpo/kilo that referenced this issue Jul 5, 2020
This commit fix the ‘UINT32_MAX’ undeclared problem in Linux
I mentioned in the issue antirez#67 by including <stdint.h>
@jawwadzafar
Copy link

@unknowntpo
this is merged. can be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants