[nmh-workers] nmh 1.7.1 compile errors

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[nmh-workers] nmh 1.7.1 compile errors

masud.anwar1

Hi,

 

I get the following compile errors compiling on solaris 10 - sparc and I’m not sure how to resolve it.

 

We are currently using version 1.3 and are looking to move to a later version as we seems to be having some issues with nmh.

 

version 1.5 compiles,

version 1.6 fails

as does version 1.7.1  see the trace below for 1.7.1.

 

Sun Compiler developer studio ansi C compiler

 

Would anyone be able be help. Please.

.

.

.

.

.

cc -DHAVE_CONFIG_H -I.   -I./sbr -DNMHBINDIR='"/export/home/edcs/nmh/bin"' -DNMHLIBEXECDIR='"/export/home/edcs/nmh/libexec/nmh"' -DNMHETCDIR='"/export/home/edcs/nmh/etc/nmh"' -DNMHDOCDIR='"/export/home/edcs/nmh/share/doc/nmh"' -DMAILSPOOL='"/var/mail"' -DSENDMAILPATH='"/usr/sbin/sendmail"'   -g -v -errtags=yes -erroff=E_STATEMENT_NOT_REACHED -Wall -Wextra -c -o sbr/sbr_libmh_a-terminal.o `test -f 'sbr/terminal.c' || echo './'`sbr/terminal.c

"/usr/include/curses.h", line 86: invalid type combination

cc: acomp failed for sbr/terminal.c

make[1]: *** [Makefile:4332: sbr/sbr_libmh_a-terminal.o] Error 2

make[1]: Leaving directory '/export/home/edcs/nmh-1.7.1'

make: *** [Makefile:1643: all] Error 2

 

 

/usr/include/curses.h

 

     1  /*

     2   * Copyright (c) 1988, 2012, Oracle and/or its affiliates. All rights reserved.

     3   */

     4

     5  /*      Copyright (c) 1988 AT&T */

     6  /*        All Rights Reserved   */

     7

     8  /*      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T     */

     9  /*      The copyright notice above does not evidence any        */

    10  /*      actual or intended publication of such source code.     */

    11

    12  #ifndef _CURSES_H

    13  #define _CURSES_H

    14

    15  #pragma ident   "@(#)curses.h   1.32    04/04/29 SMI"   /* SVr4.0 1.58  */

    16

    17  /*

    18   * curses.h - this file is automatically made from caps and

    19   *      curses.ed. Don't make changes directly to curses.h!

    20   */

    21

    22  #include <widec.h>

    23

    24  #include <stdio.h>

    25

    26  #ifdef  __cplusplus

    27  extern "C" {

    28  #endif

    29

    30  #define CSMAX   4

    31

    32  /*

    33   * This trick is used to distinguish between SYSV and V7 systems.

    34   * We assume that L_ctermid is only defined in stdio.h in SYSV

    35   * systems, but not in V7 or Berkeley UNIX.

    36   */

    37  #ifdef L_ctermid

    38  #ifdef SYSV

    39  #undef SYSV

    40  #endif

    41  #define SYSV

    42  #endif

    43  /* Some V7 systems define       L_ctermid - we list those here */

    44  #ifdef BSD

    45  #undef SYSV

    46  #endif

    47

    48  #ifdef SYSV

    49

    50  #ifndef VINTR

    51  #include <termio.h>

    52  #endif /* VINTR */

    53  typedef struct termio SGTTY;

    54  typedef struct termios SGTTYS;

    55

    56  #else /* !SYSV */

    57

    58  #ifndef _SGTTYB_

    59  #include <sgtty.h>

    60  #endif /* _SGTTYB_ */

    61  typedef struct sgttyb SGTTY;

    62

    63  /*

    64   * Here we attempt to improve portability by providing some #defines

    65   * for SYSV functions on non-SYSV systems.

    66   */

    67  #define memcpy(dst, src, len)   bcopy((src), (dst), (len))

    68  #define strchr                  index

    69  #define strrchr                 rindex

    70  #endif /* SYSV */

    71

    72  /*

    73   * bool is a built-in type in standard C++ and as such is not

    74   * defined here when using standard C++. However, the GNU compiler

    75   * fixincludes utility nonetheless creates it's own version of this

    76   * header for use by gcc and g++. In that version it adds a redundant

    77   * guard for __cplusplus. To avoid the creation of a gcc/g++ specific

    78   * header we need to include the following magic comment:

    79   *

    80   * we must use the C++ compiler's type

    81   *

    82   * The above comment should not be removed or changed until GNU

    83   * gcc/fixinc/inclhack.def is updated to bypass this header.

    84   */

    85  #if !defined(__cplusplus) && !defined(_BOOL)

    86  typedef char bool;

    87  #endif /* !defined(__cplusplus) && !defined(_BOOL) */

 

Kind Regards

 

Masud Anwar

 

 

The information in this e-mail and any attachments is confidential and may be subject to legal professional privilege. Unless you are the intended recipient or his/her representative you are not authorised to, and must not, read, copy, distribute, use or retain this message or any part of it. If you are not the intended recipient, please notify the sender immediately.

HM Revenue & Customs computer systems will be monitored and communications carried on them recorded, to secure the effective operation of the system and for lawful purposes.

The Commissioners for HM Revenue and Customs are not liable for any personal views of the sender.

This e-mail may have been intercepted and its information altered.

If you have any doubt about the authenticity of an email you receive which claims to come from HM Revenue & Customs (HMRC), please do not follow any links within the email, disclose any personal details or respond to it. Instead forward it to us at [hidden email]


--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: nmh 1.7.1 compile errors

Ralph Corderoy
Hi Masud,

> cc -DHAVE_CONFIG_H -I.   -I./sbr
>     -DNMHBINDIR='"/export/home/edcs/nmh/bin"'
>     -DNMHLIBEXECDIR='"/export/home/edcs/nmh/libexec/nmh"'
>     -DNMHETCDIR='"/export/home/edcs/nmh/etc/nmh"'
>     -DNMHDOCDIR='"/export/home/edcs/nmh/share/doc/nmh"'
>     -DMAILSPOOL='"/var/mail"' -DSENDMAILPATH='"/usr/sbin/sendmail"'
>     -g -v -errtags=yes -erroff=E_STATEMENT_NOT_REACHED -Wall -Wextra
>     -c -o sbr/sbr_libmh_a-terminal.o `test -f 'sbr/terminal.c' || echo
>     './'`sbr/terminal.c
> "/usr/include/curses.h", line 86: invalid type combination
> cc: acomp failed for sbr/terminal.c
...
>     85  #if !defined(__cplusplus) && !defined(_BOOL)
>     86  typedef char bool;
>     87  #endif /* !defined(__cplusplus) && !defined(_BOOL) */

Can you confirm config.h doesn't have HAVE_STDBOOL_H #defined?
h/nmh.h does

    #ifdef HAVE_STDBOOL_H
    # include <stdbool.h>
    #else
    # define bool int
    # define true 1
    # define false 0
    #endif

and that's probably upsetting things.
Does your Solaris C compilation environment have a stdbool.h?
Is gcc available?

--
Cheers, Ralph.

--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: nmh 1.7.1 compile errors

Ken Hornstein-2
In reply to this post by masud.anwar1
>"/usr/include/curses.h", line 86: invalid type combination

Quick question: does this compiler have a stdbool.h header file?  If it
does, does autoconf find it?  (This answer should be in the configure output).

I suspect that it does NOT, and you are running afoul of the following
defintions in h/nmh.h:

#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#else
# define bool int
# define true 1
# define false 0
#endif

So that would make that line in curses.h:

        typedef char int

Which would probably explain the exact error you are getting.

So, solutions?  Weeelll .... we use bool a lot, actually.  It looks like
bool was added in C99, so maybe adding -std=c99 to the compiler options
would work? (be sure you do that and re-run configure). It might be the
compiler doesn't "see" stdbool.h unless you do -std=c99.  I suspect
using gcc would also work.  That may not be right answer, as I think
the default is -std=c11.  You could also try adding -D_BOOL=1 to CPPFLAGS.

I don't know why older versions don't compile; support for bool was only
added in nmh 1.7.  It would probably be best to focus on the newest versions
though.

--Ken

--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: nmh 1.7.1 compile errors

Valdis Klētnieks
In reply to this post by masud.anwar1
On Mon, 03 Jun 2019 15:58:18 -0000, [hidden email] said:

> I get the following compile errors compiling on solaris 10 - sparc and I'm not sure how to resolve it.

> Sun Compiler developer studio ansi C compiler

> "/usr/include/curses.h", line 86: invalid type combination

>     85  #if !defined(__cplusplus) && !defined(_BOOL)
>     86  typedef char bool;
>     87  #endif /* !defined(__cplusplus) && !defined(_BOOL) */

Apparently, the Sun compiler has sprouted internal support for 'bool'.

Adding -D_BOOL to the CCFLAGS should work around this, but I'm not sure what
you're using to configure/build nmh, so it's unclear where the best place to
add it is.

Anybody else still using Solaris 10 with either gcc or the Sun compiler?  We'll
need some testing to make sure if we add this to the autoconfigure stuff, we
don't break it for other Solaris/compiler combinations...


--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers

attachment0 (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: nmh 1.7.1 compile errors

Valdis Klētnieks
In reply to this post by masud.anwar1
On Mon, 03 Jun 2019 15:58:18 -0000, [hidden email] said:

>     73   * bool is a built-in type in standard C++ and as such is not
>     74   * defined here when using standard C++. However, the GNU compiler
>     75   * fixincludes utility nonetheless creates it's own version of this
>     76   * header for use by gcc and g++. In that version it adds a redundant
>     77   * guard for __cplusplus. To avoid the creation of a gcc/g++ specific
>     78   * header we need to include the following magic comment:

Didn't fixincludes pass into the realm of myth and legend quite a while ago?

(Which is why I'm worried that this is brittle system code that breaks all too easily...)

--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers

attachment0 (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: nmh 1.7.1 compile errors

Ken Hornstein-2
In reply to this post by Valdis Klētnieks
>Apparently, the Sun compiler has sprouted internal support for 'bool'.

I really thought stdbool.h was part of the standard; if we detect that
then the right things should happen.

--Ken

--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers