Skip to content

Conversation

@OMGtechy
Copy link
Contributor

@OMGtechy OMGtechy commented Dec 3, 2016

Signed-off-by: Joshua Gerrard enquiries@joshuagerrard.com

@OMGtechy OMGtechy force-pushed the master branch 2 times, most recently from d917cec to ec60dc7 Compare December 7, 2016 16:13
@OMGtechy OMGtechy force-pushed the master branch 2 times, most recently from b12d8a6 to a4b1d85 Compare December 16, 2016 21:38
Copy link
Member

@jsquyres jsquyres left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay in reviewing -- December gets busy!

Joshua Gerrard
enquiries@joshuagerrard.com
technopiano@gmail.com
joshuagerrard+ompi-commit@protonmail.com
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OMGtechy Are these the emails that you committed with? We typically only show the emails that show up in git log.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of them is - I've updated accordingly.

ompi_process_info.nodename,
(int) ompi_process_info.pid) == -1) {
// non-fatal, we could still go on to give useful information here...
opal_output(0, "%s", "Could not write node and PID to prefix");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious -- why do the double-string form? You shouldn't need to use the copy through %s -- you could just put the 3rd argument directly as the 2nd arg.

Copy link
Contributor Author

@OMGtechy OMGtechy Dec 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a habit to stop situations like this:

opal_output(0, user_input, ...)

Some compilers will also omit warnings if you don't do it this way, IIRC

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, I think compilers only warn on that for libc functions (e.g., printf). They don't for opal_output. But it doesn't matter that much...

*error_code);
if (asprintf(&err_msg, unknown_error_code,
*error_code) == -1) {
opal_output(0, "%s", "Could not write to err_msg");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above -- %s doesn't seem to be needed...?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See other comment :)

asprintf(&err_msg, "Error code: %d (no associated error message)",
*error_code);
if (asprintf(&err_msg, unknown_error_code,
*error_code) == -1) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will a failed asprintf() leave NULL in err_msg? Or could it be some random value (that free(err_msg), below, will choke on)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot! I also made the same fix for prefix

@OMGtechy OMGtechy force-pushed the master branch 2 times, most recently from 8911e66 to c01bd92 Compare December 17, 2016 17:40
@OMGtechy
Copy link
Contributor Author

Sorry for the delay in reviewing -- December gets busy!

No worries! Your review comments should be addressed now.

Signed-off-by: Joshua Gerrard <joshuagerrard+ompi-commit@protonmail.com>
@jsquyres jsquyres merged commit d772fcf into open-mpi:master Dec 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants