Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #63429 > unrolled thread
| Started by | esamiira@gmail.com |
|---|---|
| First post | 2015-06-17 09:50 -0700 |
| Last post | 2015-06-17 19:07 +0100 |
| Articles | 11 — 10 participants |
Back to article view | Back to comp.lang.c
VS2015 esamiira@gmail.com - 2015-06-17 09:50 -0700
Re: VS2015 Barry Schwarz <schwarzb@dqel.com> - 2015-06-17 10:36 -0700
Re: VS2015 Keith Thompson <kst-u@mib.org> - 2015-06-17 11:05 -0700
Re: VS2015 James Kuyper <jameskuyper@verizon.net> - 2015-06-17 14:34 -0400
Re: VS2015 Melzzzzz <mel@zzzzz.com> - 2015-06-17 20:44 +0200
Re: VS2015 "Charles Richmond" <numerist@aquaporin4.com> - 2015-06-17 16:18 -0500
Re: VS2015 jacobnavia <jacob@jacob.remcomp.fr> - 2015-06-19 08:12 +0200
Re: VS2015 Paul N <gw7rib@aol.com> - 2015-06-19 07:39 -0700
Re: VS2015 jacobnavia <jacob@jacob.remcomp.fr> - 2015-06-19 17:59 +0200
Re: VS2015 raltbos@xs4all.nl (Richard Bos) - 2015-06-20 09:16 +0000
Re: VS2015 Richard Heathfield <rjh@cpax.org.uk> - 2015-06-17 19:07 +0100
| From | esamiira@gmail.com |
|---|---|
| Date | 2015-06-17 09:50 -0700 |
| Subject | VS2015 |
| Message-ID | <f7d2d395-4619-418b-8bdb-a38c322321eb@googlegroups.com> |
Microsoft Visual Studio Community 2015 RC Version 14.0.22823.1 D14REL Microsoft .NET Framework Version 4.6.00057 Installed Version: Community Windows 8.1 When compiling with VS2013 I don't get an warning, but with VS2015 I get this warning. >c:\program files (x86)\microsoft visual studio 14.0\vc\include\xlocale(654): warning C4302: 'type cast': truncation from 'const wchar_t *' to 'unsigned char' 1> c:\program files (x86)\microsoft visual studio 14.0\vc\include\xlocale(2322): note: see reference to function template instantiation 'char std::_Maklocbyte<_Elem>(_Elem,const std::_Locinfo::_Cvtvec &)' being compiled Now, I know what the problem is, VS2015 is very clear about it, but how can I trace the fault. Where in -my code- did I go wrong?
[toc] | [next] | [standalone]
| From | Barry Schwarz <schwarzb@dqel.com> |
|---|---|
| Date | 2015-06-17 10:36 -0700 |
| Message-ID | <mvb3oal715qbbo0vfccpjjt391soglm01s@4ax.com> |
| In reply to | #63429 |
On Wed, 17 Jun 2015 09:50:57 -0700 (PDT), esamiira@gmail.com wrote: >Microsoft Visual Studio Community 2015 RC > Version 14.0.22823.1 D14REL > Microsoft .NET Framework > Version 4.6.00057 > >Installed Version: Community > > >Windows 8.1 > > >When compiling with VS2013 I don't get an warning, but with VS2015 I get this warning. > >>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xlocale(654): warning C4302: 'type cast': truncation from 'const wchar_t *' to 'unsigned char' >1> c:\program files (x86)\microsoft visual studio 14.0\vc\include\xlocale(2322): note: see reference to function template instantiation 'char std::_Maklocbyte<_Elem>(_Elem,const std::_Locinfo::_Cvtvec &)' being compiled > >Now, I know what the problem is, VS2015 is very clear about it, but how can I trace the fault. Where in -my code- did I go wrong? Since C does not have templates, you might start by asking in a group related to the language you are using. -- Remove del for email
[toc] | [prev] | [next] | [standalone]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Date | 2015-06-17 11:05 -0700 |
| Message-ID | <lnwpz2jjll.fsf@nuthaus.mib.org> |
| In reply to | #63437 |
Barry Schwarz <schwarzb@dqel.com> writes:
> On Wed, 17 Jun 2015 09:50:57 -0700 (PDT), esamiira@gmail.com wrote:
>>Microsoft Visual Studio Community 2015 RC
>> Version 14.0.22823.1 D14REL
>> Microsoft .NET Framework
>> Version 4.6.00057
>>
>>Installed Version: Community
>>
>>
>>Windows 8.1
>>
>>
>>When compiling with VS2013 I don't get an warning, but with VS2015 I get this warning.
>>
>>>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xlocale(654): warning C4302: 'type cast': truncation from 'const wchar_t *' to 'unsigned char'
>>1> c:\program files (x86)\microsoft visual studio 14.0\vc\include\xlocale(2322): note: see reference to function template instantiation 'char std::_Maklocbyte<_Elem>(_Elem,const std::_Locinfo::_Cvtvec &)' being compiled
>>
>>Now, I know what the problem is, VS2015 is very clear about it, but how can I trace the fault. Where in -my code- did I go wrong?
>
> Since C does not have templates, you might start by asking in a group
> related to the language you are using.
And when you post in a C++ group, be sure to show them the code that
causes the error.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
[toc] | [prev] | [next] | [standalone]
| From | James Kuyper <jameskuyper@verizon.net> |
|---|---|
| Date | 2015-06-17 14:34 -0400 |
| Message-ID | <5581BDAF.1090903@verizon.net> |
| In reply to | #63444 |
On 06/17/2015 02:05 PM, Keith Thompson wrote: > Barry Schwarz <schwarzb@dqel.com> writes: >> On Wed, 17 Jun 2015 09:50:57 -0700 (PDT), esamiira@gmail.com wrote: >>> Microsoft Visual Studio Community 2015 RC >>> Version 14.0.22823.1 D14REL >>> Microsoft .NET Framework >>> Version 4.6.00057 >>> >>> Installed Version: Community >>> >>> >>> Windows 8.1 >>> >>> >>> When compiling with VS2013 I don't get an warning, but with VS2015 I get this warning. >>> >>>> c:\program files (x86)\microsoft visual studio 14.0\vc\include\xlocale(654): warning C4302: 'type cast': truncation from 'const wchar_t *' to 'unsigned char' >>> 1> c:\program files (x86)\microsoft visual studio 14.0\vc\include\xlocale(2322): note: see reference to function template instantiation 'char std::_Maklocbyte<_Elem>(_Elem,const std::_Locinfo::_Cvtvec &)' being compiled >>> >>> Now, I know what the problem is, VS2015 is very clear about it, but how can I trace the fault. Where in -my code- did I go wrong? >> >> Since C does not have templates, you might start by asking in a group >> related to the language you are using. > > And when you post in a C++ group, be sure to show them the code that > causes the error. He's asking "Where in -my code- did I go wrong?", so he doesn't know which code caused the error. If the above message list is complete, I see his point - the only line numbers given are for the xlocale file, which is presumably not his code. There should be an error message identifing the line on which an attempt was made to instantiate that template with types that triggered this warning. There doesn't seem to be any such message (assuming the message list is complete).
[toc] | [prev] | [next] | [standalone]
| From | Melzzzzz <mel@zzzzz.com> |
|---|---|
| Date | 2015-06-17 20:44 +0200 |
| Message-ID | <20150617204429.6c71ddcc@maxa-pc> |
| In reply to | #63449 |
On Wed, 17 Jun 2015 14:34:23 -0400 James Kuyper <jameskuyper@verizon.net> wrote: > On 06/17/2015 02:05 PM, Keith Thompson wrote: > > Barry Schwarz <schwarzb@dqel.com> writes: > >> On Wed, 17 Jun 2015 09:50:57 -0700 (PDT), esamiira@gmail.com wrote: > >>> Microsoft Visual Studio Community 2015 RC > >>> Version 14.0.22823.1 D14REL > >>> Microsoft .NET Framework > >>> Version 4.6.00057 > >>> > >>> Installed Version: Community > >>> > >>> > >>> Windows 8.1 > >>> > >>> > >>> When compiling with VS2013 I don't get an warning, but with > >>> VS2015 I get this warning. > >>> > >>>> c:\program files (x86)\microsoft visual studio > >>>> 14.0\vc\include\xlocale(654): warning C4302: 'type cast': > >>>> truncation from 'const wchar_t *' to 'unsigned char' > >>> 1> c:\program files (x86)\microsoft visual studio > >>> 1> 14.0\vc\include\xlocale(2322): note: see reference to function > >>> 1> template instantiation 'char > >>> 1> std::_Maklocbyte<_Elem>(_Elem,const std::_Locinfo::_Cvtvec &)' > >>> 1> being compiled > >>> > >>> Now, I know what the problem is, VS2015 is very clear about it, > >>> but how can I trace the fault. Where in -my code- did I go wrong? > >> > >> Since C does not have templates, you might start by asking in a > >> group related to the language you are using. > > > > And when you post in a C++ group, be sure to show them the code that > > causes the error. > > He's asking "Where in -my code- did I go wrong?", so he doesn't know > which code caused the error. > > If the above message list is complete, I see his point - the only line > numbers given are for the xlocale file, which is presumably not his > code. There should be an error message identifing the line on which an > attempt was made to instantiate that template with types that > triggered this warning. There doesn't seem to be any such message > (assuming the message list is complete). > Problem is that it is probably bug in the compiler.
[toc] | [prev] | [next] | [standalone]
| From | "Charles Richmond" <numerist@aquaporin4.com> |
|---|---|
| Date | 2015-06-17 16:18 -0500 |
| Message-ID | <mlso4c$fhr$1@dont-email.me> |
| In reply to | #63450 |
"Melzzzzz" <mel@zzzzz.com> wrote in message news:20150617204429.6c71ddcc@maxa-pc... > On Wed, 17 Jun 2015 14:34:23 -0400 > James Kuyper <jameskuyper@verizon.net> wrote: > >> On 06/17/2015 02:05 PM, Keith Thompson wrote: >> > Barry Schwarz <schwarzb@dqel.com> writes: >> >> On Wed, 17 Jun 2015 09:50:57 -0700 (PDT), esamiira@gmail.com wrote: >> >>> Microsoft Visual Studio Community 2015 RC >> >>> Version 14.0.22823.1 D14REL >> >>> Microsoft .NET Framework >> >>> Version 4.6.00057 >> >>> >> >>> Installed Version: Community >> >>> >> >>> >> >>> Windows 8.1 >> >>> >> >>> >> >>> When compiling with VS2013 I don't get an warning, but with >> >>> VS2015 I get this warning. >> >>> >> >>>> c:\program files (x86)\microsoft visual studio >> >>>> 14.0\vc\include\xlocale(654): warning C4302: 'type cast': >> >>>> truncation from 'const wchar_t *' to 'unsigned char' >> >>> 1> c:\program files (x86)\microsoft visual studio >> >>> 1> 14.0\vc\include\xlocale(2322): note: see reference to function >> >>> 1> template instantiation 'char >> >>> 1> std::_Maklocbyte<_Elem>(_Elem,const std::_Locinfo::_Cvtvec &)' >> >>> 1> being compiled >> >>> >> >>> Now, I know what the problem is, VS2015 is very clear about it, >> >>> but how can I trace the fault. Where in -my code- did I go wrong? >> >> >> >> Since C does not have templates, you might start by asking in a >> >> group related to the language you are using. >> > >> > And when you post in a C++ group, be sure to show them the code that >> > causes the error. >> >> He's asking "Where in -my code- did I go wrong?", so he doesn't know >> which code caused the error. >> >> If the above message list is complete, I see his point - the only line >> numbers given are for the xlocale file, which is presumably not his >> code. There should be an error message identifing the line on which an >> attempt was made to instantiate that template with types that >> triggered this warning. There doesn't seem to be any such message >> (assuming the message list is complete). >> > > Problem is that it is probably bug in the compiler. > Yes, your *first* mistake was using a compiler built by Microsoft!!! -- numerist at aquaporin4 dot com
[toc] | [prev] | [next] | [standalone]
| From | jacobnavia <jacob@jacob.remcomp.fr> |
|---|---|
| Date | 2015-06-19 08:12 +0200 |
| Message-ID | <mm0bps$j30$1@dont-email.me> |
| In reply to | #63463 |
Le 17/06/2015 23:18, Charles Richmond a écrit : > Yes, your *first* mistake was using a compiler built by Microsoft!!! It generates better code than gcc, the only compiler that is better in the speed of the generated code is Intel's. There are some people against microsoft for ideological reasons. I understand them but they become quite blind sometimes. That is called: EXAGGERATING
[toc] | [prev] | [next] | [standalone]
| From | Paul N <gw7rib@aol.com> |
|---|---|
| Date | 2015-06-19 07:39 -0700 |
| Message-ID | <121604f6-4ce2-420b-9d39-0c3275f2ebbe@googlegroups.com> |
| In reply to | #63569 |
On Friday, 19 June 2015 07:12:40 UTC+1, jacobnavia wrote: > Le 17/06/2015 23:18, Charles Richmond a écrit : > > Yes, your *first* mistake was using a compiler built by Microsoft!!! > > It generates better code than gcc, the only compiler that is better in > the speed of the generated code is Intel's. > > There are some people against microsoft for ideological reasons. I > understand them but they become quite blind sometimes. That is called: > > EXAGGERATING Mind you, only this week I was using GetWindowLongPtr and I thought to myself that only Microsoft would make a compiler where you can get rid of a warning by casting the result of a function call to the type the funtion returns. GetWindowLongPtr returns a LONG_PTR (according to MSDN) but VC++ complains about ppp = (int *) GetWindowLongPtr(hWnd, GWL_STYLE); (converting to a greater size) while allowing ppp = (int *) (LONG_PTR) GetWindowLongPtr(hWnd, GWL_STYLE); with no warning. Of course, one might expect GetWindowLongPtr to return an actual pointer...
[toc] | [prev] | [next] | [standalone]
| From | jacobnavia <jacob@jacob.remcomp.fr> |
|---|---|
| Date | 2015-06-19 17:59 +0200 |
| Message-ID | <mm1e6q$e66$1@dont-email.me> |
| In reply to | #63604 |
Le 19/06/2015 16:39, Paul N a écrit : [snip] Your mesage points to a very small flaw of the compiler. I didn't say that it was PERFECT, i.e. that there are no bugs in it. I just said that the generated code is better than gcc's and better than all other compilers i know of but Intel's.
[toc] | [prev] | [next] | [standalone]
| From | raltbos@xs4all.nl (Richard Bos) |
|---|---|
| Date | 2015-06-20 09:16 +0000 |
| Message-ID | <55852ef4.2374218@news.xs4all.nl> |
| In reply to | #63604 |
Paul N <gw7rib@aol.com> wrote: > Mind you, only this week I was using GetWindowLongPtr and I thought to myse= > lf that only Microsoft would make a compiler where you can get rid of a war= > ning by casting the result of a function call to the type the funtion retur= > ns. GetWindowLongPtr returns a LONG_PTR (according to MSDN) but VC++ compla= > ins about > > ppp =3D (int *) GetWindowLongPtr(hWnd, GWL_STYLE); > > (converting to a greater size) > > while allowing > > ppp =3D (int *) (LONG_PTR) GetWindowLongPtr(hWnd, GWL_STYLE); > > with no warning. Of course, one might expect GetWindowLongPtr to return an = > actual pointer... Now, it wouldn't be out of character for Mickey$oft to demand that you pervert your code like that, but a thought _does_ occur... Are you sure you #included the relevant header? This sounds as if the compiler thinks GetWindowLongPtr() _doesn't_ return a LONG_PTR. Richard
[toc] | [prev] | [next] | [standalone]
| From | Richard Heathfield <rjh@cpax.org.uk> |
|---|---|
| Date | 2015-06-17 19:07 +0100 |
| Message-ID | <mlscv4$r05$1@dont-email.me> |
| In reply to | #63429 |
On 17/06/15 17:50, esamiira@gmail.com wrote: <snip> > When compiling with VS2013 I don't get an warning, but with VS2015 I get this warning. > >>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xlocale(654): warning C4302: 'type cast': truncation from 'const wchar_t *' to 'unsigned char' > 1> c:\program files (x86)\microsoft visual studio 14.0\vc\include\xlocale(2322): note: see reference to function template instantiation 'char std::_Maklocbyte<_Elem>(_Elem,const std::_Locinfo::_Cvtvec &)' being compiled > > Now, I know what the problem is, VS2015 is very clear about it, but how can I trace the fault. Where in -my code- did I go wrong? You have the source code. We don't. So you have us at a disadvantage. If you're programming in C (and, judging from what you've written so far, that seems rather unlikely), why not post the source code that's causing problems and let us take a look? If you're programming in some other language (C++, C#, .Net, or whatever it is), you might want to try finding a newsgroup that's a closer match to your language choice). -- Richard Heathfield Email: rjh at cpax dot org dot uk "Usenet is a strange place" - dmr 29 July 1999 Sig line 4 vacant - apply within
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.c
csiph-web