#24 lcms 2.0a - missing unistd.h include


It seems transicc.c is missing

#include <unistd.h>

to avoid this compiler warning:

transicc.c:591:9: warning: implicit declaration of function ‘isatty’

This is about lcms 2.0a.


  • Marti Maria Saguer

    • status: open --> open-accepted
  • Marti Maria Saguer

    Thanks for reporting. Unfortunately unistd.h is not supported by all compilers, and this warning would become a fatal error for those not supporting the include. I'm, however, searching for a suitable solution.

  • Bob Friesenhahn

    Bob Friesenhahn - 2010-07-20

    The unistd.h header should be supported on any POSIX-conformant system (since 1988). It seems likely that isatty() is only supported on POSIX-type systems. The isatty() function is defined by IEEE-std 1003.1-1988 (i.e. POSIX.1). It should be safe to include unistd.h wherever isatty() is used.

  • Nobody/Anonymous

    Bob, you are right but unfortunately unistd.h it is not part of C99, at least my C99 PDF does not mention it. MS VC also doesn't support it (yep, I know VC does not conform to any standard, but we have to live with that). Maybe I should get rid of isatty function call instead. It is used only to provide a prompt, which may be taken only as a cosmetic feature.

  • Samuli Suominen

    Samuli Suominen - 2011-06-12

    As the problem is still present in version 2 2, a developer for Gentoo Linux proposed this patch for the issue:

    --- lcms2-2.2/utils/transicc/transicc.c.orig
    +++ lcms2-2.2/utils/transicc/transicc.c
    @@ -26,6 +26,10 @@

    #include "utils.h"

    +#ifndef _MSC_VER
    +#include <unistd.h>
    #ifdef CMS_IS_WINDOWS_
    #include <io.h>

  • Marti Maria Saguer

    fixed in git, thanks for reporting

  • Marti Maria Saguer

    • status: open-accepted --> open-fixed

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks