public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* wide char support and -fshort-wchar option
@ 2014-07-31  8:31 Mallikarjun Goudar
  2014-08-01 15:34 ` Ian Lance Taylor
  0 siblings, 1 reply; 3+ messages in thread
From: Mallikarjun Goudar @ 2014-07-31  8:31 UTC (permalink / raw)
  To: gcc-help

Hi,
I would like to use wchar_t as unsigned short. I used -fshort-wchar
option to make this happen.
But i get following warnings when compile and link a test case.

'libc.a(ansi_files.o) uses 4-byte wchar_t yet the output is to use
2-byte wchar_t; use of wchar_t values across objects may fail"'

To resolve this, i should be rebuilding gcc libraries with -fshort-wchar option?

Please let me know.

Thanks,
Mallikarjuna

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: wide char support and -fshort-wchar option
  2014-07-31  8:31 wide char support and -fshort-wchar option Mallikarjun Goudar
@ 2014-08-01 15:34 ` Ian Lance Taylor
  2014-08-04  6:23   ` Mallikarjun Goudar
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Lance Taylor @ 2014-08-01 15:34 UTC (permalink / raw)
  To: Mallikarjun Goudar; +Cc: gcc-help

On Thu, Jul 31, 2014 at 1:31 AM, Mallikarjun Goudar
<mallikarjun.gouda@gmail.com> wrote:
>
> I would like to use wchar_t as unsigned short. I used -fshort-wchar
> option to make this happen.
> But i get following warnings when compile and link a test case.
>
> 'libc.a(ansi_files.o) uses 4-byte wchar_t yet the output is to use
> 2-byte wchar_t; use of wchar_t values across objects may fail"'
>
> To resolve this, i should be rebuilding gcc libraries with -fshort-wchar option?

libc.a is not a GCC library.  It's the C library, which does not come
with GCC.  To avoid that warning you will have to rebuild libc.a.  Or,
of course, you can ignore the warning and be careful not to pass
wchar_t values to libc.

Ian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: wide char support and -fshort-wchar option
  2014-08-01 15:34 ` Ian Lance Taylor
@ 2014-08-04  6:23   ` Mallikarjun Goudar
  0 siblings, 0 replies; 3+ messages in thread
From: Mallikarjun Goudar @ 2014-08-04  6:23 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-help

On 1 August 2014 21:04, Ian Lance Taylor <iant@google.com> wrote:
> On Thu, Jul 31, 2014 at 1:31 AM, Mallikarjun Goudar
> <mallikarjun.gouda@gmail.com> wrote:
>>
>> I would like to use wchar_t as unsigned short. I used -fshort-wchar
>> option to make this happen.
>> But i get following warnings when compile and link a test case.
>>
>> 'libc.a(ansi_files.o) uses 4-byte wchar_t yet the output is to use
>> 2-byte wchar_t; use of wchar_t values across objects may fail"'
>>
>> To resolve this, i should be rebuilding gcc libraries with -fshort-wchar option?
>
> libc.a is not a GCC library.  It's the C library, which does not come
> with GCC.  To avoid that warning you will have to rebuild libc.a.  Or,
> of course, you can ignore the warning and be careful not to pass
> wchar_t values to libc.
>
> Ian


Hi Ian,

Thanks for the reply.

//mallikarjuna

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-04  6:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-31  8:31 wide char support and -fshort-wchar option Mallikarjun Goudar
2014-08-01 15:34 ` Ian Lance Taylor
2014-08-04  6:23   ` Mallikarjun Goudar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).