-
Notifications
You must be signed in to change notification settings - Fork 24
Fix compiler warnings #51
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
base: master-old
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -333,7 +333,8 @@ startProxy() | |
// Read from stdout of lh_proxy full lh_info struct, including orig memRange. | ||
close(pipefd_out[1]); // close write end of pipe | ||
// FIXME: should be a readall. Check for return error code. | ||
if (read(pipefd_out[0], &lh_info, sizeof lh_info) < sizeof lh_info) { | ||
if ((unsigned long) read(pipefd_out[0], &lh_info, sizeof lh_info) | ||
< sizeof lh_info) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
JWARNING(false)(JASSERT_ERRNO) .Text("Read fewer bytes than expected"); | ||
break; | ||
} | ||
|
@@ -352,7 +353,6 @@ findLHMemRange(MemRange_t *lh_mem_range) | |
bool is_set = false; | ||
|
||
Area area; | ||
char prev_path_name[PATH_MAX]; | ||
char next_path_name[PATH_MAX]; | ||
uint64_t prev_addr_end; | ||
uint64_t next_addr_start; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,7 +130,8 @@ TwoPhaseAlgo::commit_begin(MPI_Comm comm) | |
// Set state again incase we returned from beforeTrivialBarrier | ||
MPI_Request request; | ||
MPI_Comm realComm = VIRTUAL_TO_REAL_COMM(comm); | ||
int flag = 0; | ||
// Consider removing the #if 0 segment below? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know what's the purpose of the But in C++, we usually define the variable right before we use it, so you can move this line to 145 if we don't want to remove that |
||
// int flag = 0; | ||
int tb_rc = -1; | ||
JUMP_TO_LOWER_HALF(lh_info.fsaddr); | ||
tb_rc = NEXT_FUNC(Ibarrier)(realComm, &request); | ||
|
@@ -198,8 +199,6 @@ TwoPhaseAlgo::replayTrivialBarrier() | |
if (_replayTrivialBarrier) { | ||
MPI_Request request; | ||
MPI_Comm realComm = VIRTUAL_TO_REAL_COMM(_comm); | ||
int flag = 0; | ||
int tb_rc = -1; | ||
JUMP_TO_LOWER_HALF(lh_info.fsaddr); | ||
tb_rc = NEXT_FUNC(Ibarrier)(realComm, &request); | ||
RETURN_TO_UPPER_HALF(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -468,6 +468,9 @@ int discover_union_ckpt_images(char *argv[], | |
return rank; | ||
} | ||
|
||
// This is to satisfy compiler warnings, although we can probably just remove | ||
// it. | ||
#if 0 | ||
NO_OPTIMIZE | ||
static unsigned long int | ||
mygetauxval(char **evp, unsigned long int type) | ||
|
@@ -480,6 +483,7 @@ mygetauxval(char **evp, unsigned long int type) | |
} | ||
return 0; | ||
} | ||
#endif | ||
|
||
NO_OPTIMIZE | ||
static int | ||
|
@@ -512,7 +516,7 @@ uint64_t vdsoStartTmp = 0; | |
static void | ||
remap_vdso_and_vvar_regions() { | ||
Area area; | ||
int rc = 0; | ||
void *rc = 0; | ||
uint64_t vvarStart = 0; | ||
uint64_t vdsoStart = 0; | ||
uint64_t vvarSize = 0; | ||
|
@@ -527,11 +531,11 @@ remap_vdso_and_vvar_regions() { | |
|
||
while (mtcp_readmapsline(mapsfd, &area)) { | ||
if (mtcp_strcmp(area.name, "[vvar]") == 0) { | ||
vvarStart = area.addr; | ||
vvarSize = area.size; | ||
vvarStart = (uint64_t) area.addr; | ||
vvarSize = (uint64_t) area.size; | ||
} else if (mtcp_strcmp(area.name, "[vdso]") == 0) { | ||
vdsoStart = area.addr; | ||
vdsoSize = area.size; | ||
vdsoStart = (uint64_t) area.addr; | ||
vdsoSize = (uint64_t) area.size; | ||
} | ||
|
||
if (vvarStart > 0 && vdsoStart > 0) { | ||
|
@@ -542,7 +546,7 @@ remap_vdso_and_vvar_regions() { | |
mtcp_sys_lseek(mapsfd, 0, SEEK_SET); | ||
|
||
while (mtcp_readmapsline(mapsfd, &area)) { | ||
if (prev_addr + vvarSize + vdsoSize <= area.addr) { | ||
if (prev_addr + vvarSize + vdsoSize <= (uint64_t) area.addr) { | ||
vvarStartTmp = prev_addr; | ||
vdsoStartTmp = prev_addr + vvarSize; | ||
break; | ||
|
@@ -710,8 +714,6 @@ main(int argc, char *argv[], char **environ) | |
// If we want to test this, we can add code to do a trial mremap with a page | ||
// before vvar and after vdso, and verify that we get an EFAULT. | ||
// In May, 2020, on Cori and elsewhere, vvar is 3 pages and vdso is 2 pages. | ||
char *vdsoStart = (char *)mygetauxval(environ, AT_SYSINFO_EHDR); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this for and why removing this line? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is a currently unused variable that was previously used when determining where to temporarily map the |
||
|
||
remap_vdso_and_vvar_regions(); | ||
|
||
// Now that we moved vdso/vvar, we need to update the vdso address | ||
|
@@ -773,10 +775,12 @@ main(int argc, char *argv[], char **environ) | |
// mtcp_restart is statically linked, and doesn't need it. | ||
Area heap_area; | ||
MTCP_ASSERT(getMappedArea(&heap_area, "[heap]") == 1); | ||
start1 = max(heap_area.endAddr, lh_info.memRange.end); | ||
start1 = (char *) max((uint64_t) heap_area.endAddr, | ||
(uint64_t) lh_info.memRange.end); | ||
Area stack_area; | ||
MTCP_ASSERT(getMappedArea(&stack_area, "[stack]") == 1); | ||
end1 = min(stack_area.endAddr - 4 * GB, highMemStart - 4 * GB); | ||
end1 = (char *) min((uint64_t) stack_area.endAddr - 4 * GB, | ||
(uint64_t) highMemStart - 4 * GB); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should be very careful when performing |
||
start2 = 0; | ||
end2 = start2; | ||
} | ||
|
@@ -1432,10 +1436,10 @@ unmap_memory_areas_and_restore_vdso(RestoreInfo *rinfo, LowerHalfInfo_t *lh_info | |
// Do not unmap lower half | ||
DPRINTF("Skipping lower half memory section: %p-%p\n", | ||
area.addr, area.endAddr); | ||
} else if (area.addr == vdsoStartTmpCopy) { | ||
} else if ((uint64_t) area.addr == vdsoStartTmpCopy) { | ||
DPRINTF("Skipping temporary vDSO section: %p-%p\n", | ||
area.addr, area.endAddr); | ||
} else if (area.addr == vvarStartTmpCopy) { | ||
} else if ((uint64_t) area.addr == vvarStartTmpCopy) { | ||
DPRINTF("Skipping temporary vvar section: %p-%p\n", | ||
area.addr, area.endAddr); | ||
} else if (area.size > 0) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'd preferably like to make this possible to disable (like through a
--disable-werror
flag), but i'm not sure how to exclude this flag from$ac_unrecognized_opts
.