hsjung1305 / stressapptest

Automatically exported from code.google.com/p/stressapptest
Apache License 2.0
0 stars 0 forks source link

fix mmap call in os.cc (use 0, not NULL) #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
the current os.cc code does:
        shmaddr = mmap64(NULL, length, PROT_READ | PROT_WRITE,
                         MAP_SHARED | MAP_NORESERVE | MAP_LOCKED | MAP_POPULATE,
                         shm_object, NULL);

the last arg is an off_t, not a pointer, so that should be 0, not NULL

otherwise, building on recent glibc/linux yields an ugly warning:
os.cc:473:44: warning: passing NULL to non-pointer argument 6 of ‘void* 
mmap64(void*, size_t, int, int, int, __off64_t)’ [-Wconversion-null]

Original issue reported on code.google.com by vapier@gmail.com on 27 Nov 2012 at 7:00

GoogleCodeExporter commented 9 years ago
Was fixed some time ago.

Original comment by nick.j.s...@gmail.com on 11 Feb 2014 at 7:36