This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: 16 bits char string from C to FORTRAN
- From: Ian Lance Taylor <iant at google dot com>
- To: Americo Barbosa da Cunha Junior <americo dot cunhajr at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 23 Apr 2009 20:31:58 -0700
- Subject: Re: 16 bits char string from C to FORTRAN
- References: <b7e3a9c0904231550x28217ab0v4a6abd0b02132696@mail.gmail.com> <b7e3a9c0904231558g25f215la8802b76bb0e0e41@mail.gmail.com>
Americo Barbosa da Cunha Junior <americo.cunhajr@gmail.com> writes:
> I'm calling a FORTRAN subroutine in a ANSI C program. The subroutine
> has the following prototype:
This message is not appropriate for the mailing list gcc@gcc.gnu.org,
which is for gcc developers. This question would have been appropriate
on gcc-help@gcc.gnu.org or fortran@gcc.gnu.org. Thanks.
> I've tried to change the length of the char type in C redefining
> CHAR_BIT constant:
>
> #include <limits.h>
> #define CHAR_BIT 16
Doing that does not change the size of the char type. Unless you are
using an unusual embedded processor, the size of char in C is always 8.
If you need a string whose characters are a different length, you need
to use a wide character string, via L"". Wide characters in C is a
general topic in C and is not specific to gcc, and this mailing list is
not the right place to discuss them.
Ian