You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix warnings from older C compilers that do not like literal strings
that are over 4095 characters line. Admittedly do this by hueristic:
make each line in a show_help INI help file be its own string (rather
than joining all the lines in a given [section] together). I.e.,
assume that each individual line is less than 4095 characters.
Also make a few other improvements:
* Remove an unused string in show_help.c
* Fixed a problem where leading spaces were trimmed from the help text
files in the resulting C strings.
* Fixed a problem where blank lines were snipped from the help text
files in the resulting C strings.
* Simplify the Python generation script by statically initialzing one
large struct named help_files (vs. initializing a struct per help
file, and then initializing a 2nd struct to map the filenames to all
the individual per-file structs).
* Also use C99-style name-specified initializers, making the
resulting code mode human-readable.
* Also add comments at the end of each INI section and filename to
make the resulting code more human readable.
* Use C99-style "{0}" to mark empty / end-of-array sentinel values.
* At run time, the individual lines of a given show_help section are
opal_argv_join()'ed together and emitted. The alloc'ed string is
cached (just in case it is used again -- which it likely won't be)
and freed during opal_finalize().
The resulting generated static initialization code looks like this:
```c
static file_entry help_files[] = {
{
.filename = "help-opal-wrapper.txt",
.entries = (ini_entry[]) {
{
.section = "no-language-support",
.content = (const char*[]) {
"Unfortunately, this installation of Open MPI was not compiled with",
"%s support. As such, the %s compiler is non-functional.",
NULL
},
}, // End of section no-language-support
{0}
}, // End of file help-opal-wrapper.txt
},
{0}
};
```
Signed-off-by: Jeff Squyres <[email protected]>
0 commit comments