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

Warnings on OS X when compiling 4.02.0+beta1 (Xcode 5.1.1) #6439

Closed
vicuna opened this issue May 22, 2014 · 4 comments

Comments

Projects
None yet
2 participants
@vicuna
Copy link

commented May 22, 2014

Original bug ID: 6439
Reporter: @johnwhitington
Assigned to: @mshinwell
Status: closed (set by @xavierleroy on 2015-12-11T18:27:44Z)
Resolution: fixed
Priority: normal
Severity: minor
Platform: Mac
OS: OS X
OS Version: 10.9.2
Target version: 4.02.0+dev
Fixed in version: 4.02.0+dev
Category: ~DO NOT USE (was: OCaml general)

Bug description

I'm not qualified to know if these matter or not, but I report them for completeness. Note that "gcc" is clang here.

gcc -DCAML_NAME_SPACE -O -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT -c -o backtrace.o backtrace.c
backtrace.c:294:20: warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare]
for(j--; j >= 0; j--)
~ ^ ~
1 warning generated.

gcc -c -DCAML_NAME_SPACE -O -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT backtrace.pic.c
backtrace.pic.c:294:20: warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare]
for(j--; j >= 0; j--)
~ ^ ~

gcc -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT -I../../byterun -O -I../unix -DIN_OCAML_BIGARRAY -DCAML_NAME_SPACE -c mmap_unix.c
mmap_unix.c:156:10: warning: 'getpagesize' is deprecated [-Wdeprecated-declarations]
page = getpagesize();
^
/usr/include/unistd.h:556:6: note: 'getpagesize' declared here
int getpagesize(void) __pure2 __POSIX_C_DEPRECATED(199506L);
^
mmap_unix.c:192:18: warning: 'getpagesize' is deprecated [-Wdeprecated-declarations]
uintnat page = getpagesize();
^
/usr/include/unistd.h:556:6: note: 'getpagesize' declared here
int getpagesize(void) __pure2 __POSIX_C_DEPRECATED(199506L);
^
2 warnings generated.

@vicuna

This comment has been minimized.

Copy link
Author

commented May 23, 2014

Comment author: @damiendoligez

getpagesize has been like that for quite some time, but the backtrace.c problem looks serious.

@vicuna

This comment has been minimized.

Copy link
Author

commented May 23, 2014

Comment author: @jhjourdan

For backtrace.c, there is indeed a problem, that can be easily solved by replacing "uintnat j;" by "intnat j;" at line 233.

@vicuna

This comment has been minimized.

Copy link
Author

commented May 30, 2014

Comment author: @mshinwell

I agree that this fix looks correct for backtrace.c. I've committed that to 4.02 and trunk.

I'm looking at getpagesize now.

@vicuna

This comment has been minimized.

Copy link
Author

commented May 30, 2014

Comment author: @mshinwell

I've committed a change to use sysconf(_SC_PAGESIZE) rather than getpagesize(), the latter of which has I think been removed entirely as of POSIX.1-2001. Seems ok on x86-64 Linux and Mac OS X.

@vicuna vicuna closed this Dec 11, 2015

@vicuna vicuna added this to the 4.02.0 milestone Mar 14, 2019

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.