[m-rev.] for review: automatic test to enable deep profiling

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Jun 6 05:59:26 AEST 2001


On 05-Jun-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> +++ configure.in	2001/06/05 15:32:22
> @@ -2109,12 +2109,16 @@
>  #
>  # Add an option that disables the deep profiler.
>  #
> -AC_ARG_ENABLE(deep-profiler,
> -    [  --enable-deep-profiler  enable the deep profiler],
> -	mercury_cv_enable_deep_profiler="$enableval",
> -	mercury_cv_enable_deep_profiler=no
> -)
>  AC_MSG_CHECKING(whether to enable the deep profiler)
> +
> +    # This test may need to be made more specific at a later date.  For
> +    # moment it is sufficient to distinguish between win32 and unix systems.
> +if test "$HAVE_UNISTD_H" = 1; then
> +    mercury_cv_enable_deep_profiler=yes
> +else
> +    mercury_cv_enable_deep_profiler=no
> +fi

The code here is fine, but the comment is not.

For deep profiling, we want to distinguish not between win32 and unix,
but between Posix systems and non-Posix systems (i.e. between systems
which support the relevent Posix standards and systems don't support
those standards).

Pete, after all the trouble you've had with portability,
e.g. having to fix these problems with deep profiling,
I wish you would learn to think about this a bit more abstractly.
The reason the comment worries me is not so much because it would
in and of itself be terribly misleading, but more because of what
it reveals about your thought processes ;-)

The idea should not be to distinguish between win32 and unix systems.
That approach never works in the long run, because someone always comes
up with a different system that is neither win32 nor unix, or which is
*both* win32 and unix.  So please remember this idea: always test for
feature sets, not for particular implementations.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list