You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Andrew Black <ab...@roguewave.com> on 2006/07/28 17:03:21 UTC

Exec util bugfix [patch]

Greetings all.

Attached is a patch that cleans up some of the internal logic of the 
exec utility.  The main purpose is to remove the dependency on the diff 
utility and make the error handling more consistent.

--Andrew Black

Log:
2006-07-28  Andrew Black <ab...@roguewave.com>
	* cmdopt.h (target_name): Declared global variable indicating current 
target
	* cmdopt.cpp (eval_options): Route unknown option message to stderr 
rather than stdout
	* cmdopt.cpp (split_child_opts): Cache output of a strlen() call
	* util.h (warn): Declared
	* util.cpp (warn): Add utility function for generating a (non-fatal) 
error message.
	* util.cpp (terminate): Add executable and target name to output.
	* output.h (parse_output): Alter prototype
	* exec.h (exec_file): Ditto
	* output.cpp (FILE_TEST, check_example): Alter check_example to remove 
reliance on the diff utility, remove FILE_TEST as unneeded.
	* output.cpp (check_test, check_compat_test, parse_output): Move 
opening of output file to parse_output.
	* exec.cpp (wait_for_child, exec_file): use warn() utility
	* runall.cpp (check_target_ok): Ditto
	* runall.cpp (process_results): Alter signature, alter call to parse_output
	* runall.cpp (run_target): set/use target_name global, alter calls to 
exec_file and process_results

Re: Exec util bugfix [patch]

Posted by Martin Sebor <se...@roguewave.com>.
Andrew Black wrote:
> Greetings all.
[...]
> Log:
> 2006-07-28  Andrew Black <ab...@roguewave.com>
>     * cmdopt.h (target_name): Declared global variable indicating 
> current target
>     * cmdopt.cpp (eval_options): Route unknown option message to stderr 
> rather than stdout

One nit about the ChangeLog: please be consitent in your use of
past tense (i.e., "Declared variable..." and "Routed message...")
and don't forget to end your sentences with a period :) (Oh, and
also remember to capitalize the first letter of each sentence :)

Thanks
Martin

>     * cmdopt.cpp (split_child_opts): Cache output of a strlen() call
>     * util.h (warn): Declared
>     * util.cpp (warn): Add utility function for generating a (non-fatal) 
> error message.
>     * util.cpp (terminate): Add executable and target name to output.
>     * output.h (parse_output): Alter prototype
>     * exec.h (exec_file): Ditto
>     * output.cpp (FILE_TEST, check_example): Alter check_example to 
> remove reliance on the diff utility, remove FILE_TEST as unneeded.
>     * output.cpp (check_test, check_compat_test, parse_output): Move 
> opening of output file to parse_output.
>     * exec.cpp (wait_for_child, exec_file): use warn() utility
>     * runall.cpp (check_target_ok): Ditto
>     * runall.cpp (process_results): Alter signature, alter call to 
> parse_output
>     * runall.cpp (run_target): set/use target_name global, alter calls 
> to exec_file and process_results

Re: Exec util bugfix [patch]

Posted by Martin Sebor <se...@roguewave.com>.
Andrew Black wrote:
> Greetings all.
> 
> Attached is a patch that cleans up some of the internal logic of the 
> exec utility.  The main purpose is to remove the dependency on the diff 
> utility and make the error handling more consistent.

This is in: http://svn.apache.org/viewvc?rev=426676&view=rev

Btw., we'll need to clean up the failures that we get with EDG eccp
(below). They happen because with that compiler we use a super-anal
mode where only the names required to be declared by the standard
are declared in the standard headers. I think the only way to deal
with this will be to compile the utility in a less strict mode,
will mean changing the command line options and also removing the
-I from our command line. And when we do that, we might as well
compile the whole thing as C (and make the changes to the build
infrastructure to allow that in general).

Martin

eccp -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG 
-D_RWSTD_USE_CONFIG -I/build/sebor/dev/stdlib/include 
-I/build/sebor/eccp-3.8-11s/include 
-I/build/sebor/dev/stdlib/include/loc  -A -x 
--template_directory=/build/sebor/eccp-3.8-11s/lib -g 
--display_error_number --remarks --diag_suppress 
193,236,340,401,261,479,487,678,679,815 
/build/sebor/dev/stdlib/src/util/exec.cpp
"/build/sebor/dev/stdlib/src/util/exec.cpp", line 247: error #20: identifier
           "snprintf" is undefined
       snprintf (def, sizeof def, "SIG#%d", signo);
       ^

"/build/sebor/dev/stdlib/src/util/exec.cpp", line 265: error #20: identifier
           "SIGALRM" is undefined
       if (SIGALRM == signo)
           ^

"/build/sebor/dev/stdlib/src/util/exec.cpp", line 295: error #20: identifier
           "SIGHUP" is undefined
           SIGHUP, SIGINT, SIGTERM, SIGKILL, SIGKILL
           ^

"/build/sebor/dev/stdlib/src/util/exec.cpp", line 295: error #20: identifier
           "SIGKILL" is undefined
           SIGHUP, SIGINT, SIGTERM, SIGKILL, SIGKILL
                                    ^

"/build/sebor/dev/stdlib/src/util/exec.cpp", line 300: error #70: incomplete
           type is not allowed
       struct sigaction act;
                        ^

"/build/sebor/dev/stdlib/src/util/exec.cpp", line 323: error #70: incomplete
           type is not allowed
       sigaction (SIGALRM, &act, 0);
       ^

"/build/sebor/dev/stdlib/src/util/exec.cpp", line 323: error #20: identifier
           "SIGALRM" is undefined
       sigaction (SIGALRM, &act, 0);
                  ^

"/build/sebor/dev/stdlib/src/util/exec.cpp", line 323: error #18: expected a
           ")"
       sigaction (SIGALRM, &act, 0);
                         ^

"/build/sebor/dev/stdlib/src/util/exec.cpp", line 343: error #20: identifier
           "EINTR" is undefined
               if (EINTR == errno && alarm_timeout) {
                   ^

"/build/sebor/dev/stdlib/src/util/exec.cpp", line 355: error #20: identifier
           "kill" is undefined
                   (void)kill (child_pid, signals [siginx]);
                         ^

"/build/sebor/dev/stdlib/src/util/exec.cpp", line 380: error #20: identifier
           "EINVAL" is undefined
               else if (EINVAL == errno) {
                        ^

"/build/sebor/dev/stdlib/src/util/exec.cpp", line 387: error #20: identifier
           "ECHILD" is undefined
               else if (ECHILD == errno) {
                        ^

"/build/sebor/dev/stdlib/src/util/exec.cpp", line 457: error #20: identifier
           "ENOENT" is undefined
           if (ENOENT != errno)
               ^

"/build/sebor/dev/stdlib/src/util/exec.cpp", line 566: error #20: identifier
           "fdopen" is undefined
               error_file = fdopen (error_cache,"a");
                            ^

14 errors detected in the compilation of 
"/build/sebor/dev/stdlib/src/util/exec.cpp".