SERVING THE QUANTITATIVE FINANCE COMMUNITY

 
User avatar
Cuchulainn
Posts: 56926
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Re: Stupid question of the day

January 10th, 2018, 3:49 pm

katastrofa wrote:
const int VARIABLE_1 = 100;
const int VARIABLE_2 = 200;

int main(void) {
     std::vector<int> (VARIABLE_1*VARIABLE_2);
}

I forgot to put the name of the vector. It complied without warnings. No comprendo.

I think it is just an example of an anonymous object generated by the compiler. Nessuno problema secondo me. Hai capito?
#include <iostream>
#include <vector>

const int VARIABLE_1 = 10;
const int VARIABLE_2 = 20;

struct C
{
 C() { std::cout << "Antioch "; }
};


void f()
{
 std::vector<C>(VARIABLE_1*VARIABLE_2);
}

int main() {
 f();
}

 
User avatar
Cuchulainn
Posts: 56926
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Re: Stupid question of the day

January 10th, 2018, 3:56 pm

outrun wrote:
Funny.
The vector will exist during that single statement and then gets immediately destroyed.

If you write a custom class that prints some stuff in the constructor/destructor then you can see that happen.

It might be useful, ..it's valid c++!

Indeed.
 
User avatar
katastrofa
Posts: 6281
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

Re: Stupid question of the day

January 10th, 2018, 4:11 pm

Thanks, I was just surprised that the compiler didn't give me any warning. I get confused by VS sometimes.
 
User avatar
Cuchulainn
Posts: 56926
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Re: Stupid question of the day

January 10th, 2018, 4:24 pm

katastrofa wrote:
Thanks, I was just surprised that the compiler didn't give me any warning. I get confused by VS sometimes.

Goto project properties and enable all warnings 
Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(278): warning C4514: 'fpclassify': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(283): warning C4514: 'fpclassify': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(288): warning C4514: 'fpclassify': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(293): warning C4514: 'signbit': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(298): warning C4514: 'signbit': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(303): warning C4514: 'signbit': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(308): warning C4514: '_fpcomp': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(313): warning C4514: '_fpcomp': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(318): warning C4514: '_fpcomp': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(794): warning C4514: '_chgsignl': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(801): warning C4514: '_copysignl': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(855): warning C4514: '_hypotl': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(17): warning C4514: 'abs': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(22): warning C4514: 'pow': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(30): warning C4514: 'abs': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(35): warning C4514: 'acos': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(40): warning C4514: 'acosh': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(45): warning C4514: 'asin': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(50): warning C4514: 'asinh': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(55): warning C4514: 'atan': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(60): warning C4514: 'atanh': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(65): warning C4514: 'atan2': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(70): warning C4514: 'cbrt': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(75): warning C4514: 'ceil': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(80): warning C4514: 'copysign': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(86): warning C4514: 'cos': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(91): warning C4514: 'cosh': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(96): warning C4514: 'erf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(101): warning C4514: 'erfc': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(106): warning C4514: 'exp': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(111): warning C4514: 'exp2': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(116): warning C4514: 'expm1': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(121): warning C4514: 'fabs': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(126): warning C4514: 'fdim': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(131): warning C4514: 'floor': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(136): warning C4514: 'fma': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(142): warning C4514: 'fmax': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(147): warning C4514: 'fmin': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(152): warning C4514: 'fmod': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(157): warning C4514: 'frexp': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(162): warning C4514: 'hypot': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(167): warning C4514: 'ilogb': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(172): warning C4514: 'ldexp': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(177): warning C4514: 'lgamma': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(182): warning C4514: 'llrint': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(187): warning C4514: 'llround': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(192): warning C4514: 'log': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(197): warning C4514: 'log10': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(202): warning C4514: 'log1p': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(207): warning C4514: 'log2': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(212): warning C4514: 'logb': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(217): warning C4514: 'lrint': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(222): warning C4514: 'lround': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(227): warning C4514: 'modf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(232): warning C4514: 'nearbyint': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(237): warning C4514: 'nextafter': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(242): warning C4514: 'nexttoward': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(248): warning C4514: 'pow': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(254): warning C4514: 'pow': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(262): warning C4514: 'remainder': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(267): warning C4514: 'remquo': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(273): warning C4514: 'rint': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(278): warning C4514: 'round': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(283): warning C4514: 'scalbln': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(288): warning C4514: 'scalbn': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(293): warning C4514: 'sin': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(298): warning C4514: 'sinh': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(303): warning C4514: 'sqrt': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(308): warning C4514: 'tan': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(313): warning C4514: 'tanh': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(318): warning C4514: 'tgamma': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(323): warning C4514: 'trunc': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(328): warning C4514: 'abs': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(333): warning C4514: 'acos': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(338): warning C4514: 'acosh': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(343): warning C4514: 'asin': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(348): warning C4514: 'asinh': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(353): warning C4514: 'atan': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(358): warning C4514: 'atanh': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(363): warning C4514: 'atan2': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(369): warning C4514: 'cbrt': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(374): warning C4514: 'ceil': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(379): warning C4514: 'copysign': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(385): warning C4514: 'cos': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(390): warning C4514: 'cosh': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(395): warning C4514: 'erf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(400): warning C4514: 'erfc': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(405): warning C4514: 'exp': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(410): warning C4514: 'exp2': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(415): warning C4514: 'expm1': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(420): warning C4514: 'fabs': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(425): warning C4514: 'fdim': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(431): warning C4514: 'floor': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(436): warning C4514: 'fma': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(442): warning C4514: 'fmax': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(448): warning C4514: 'fmin': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(454): warning C4514: 'fmod': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(460): warning C4514: 'frexp': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(466): warning C4514: 'hypot': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(472): warning C4514: 'ilogb': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(477): warning C4514: 'ldexp': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(483): warning C4514: 'lgamma': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(488): warning C4514: 'llrint': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(493): warning C4514: 'llround': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(498): warning C4514: 'log': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(503): warning C4514: 'log10': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(508): warning C4514: 'log1p': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(513): warning C4514: 'log2': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(518): warning C4514: 'logb': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(523): warning C4514: 'lrint': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(528): warning C4514: 'lround': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(533): warning C4514: 'modf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(539): warning C4514: 'nearbyint': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(544): warning C4514: 'nextafter': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(550): warning C4514: 'nexttoward': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(556): warning C4514: 'pow': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(562): warning C4514: 'pow': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(571): warning C4514: 'remainder': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(577): warning C4514: 'remquo': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(583): warning C4514: 'rint': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(588): warning C4514: 'round': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(593): warning C4514: 'scalbln': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(599): warning C4514: 'scalbn': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(605): warning C4514: 'sin': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(610): warning C4514: 'sinh': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(615): warning C4514: 'sqrt': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(620): warning C4514: 'tan': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(625): warning C4514: 'tanh': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(630): warning C4514: 'tgamma': unreferenced inline function has been removed
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath(635): warning C4514: 'trunc': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdlib.h(354): warning C4514: 'abs': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdlib.h(359): warning C4514: 'abs': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdlib.h(364): warning C4514: 'div': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdlib.h(369): warning C4514: 'div': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(309): warning C4514: 'vfwprintf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(340): warning C4514: 'vfwprintf_s': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(371): warning C4514: '_vfwprintf_p': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(385): warning C4514: '_vwprintf_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(399): warning C4514: 'vwprintf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(412): warning C4514: '_vwprintf_s_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(428): warning C4514: 'vwprintf_s': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(443): warning C4514: '_vwprintf_p_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(457): warning C4514: '_vwprintf_p': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(470): warning C4514: '_fwprintf_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(489): warning C4514: 'fwprintf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(507): warning C4514: '_fwprintf_s_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(528): warning C4514: 'fwprintf_s': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(548): warning C4514: '_fwprintf_p_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(567): warning C4514: '_fwprintf_p': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(585): warning C4514: '_wprintf_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(603): warning C4514: 'wprintf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(620): warning C4514: '_wprintf_s_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(640): warning C4514: 'wprintf_s': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(659): warning C4514: '_wprintf_p_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(677): warning C4514: '_wprintf_p': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(726): warning C4514: 'vfwscanf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(759): warning C4514: 'vfwscanf_s': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(774): warning C4514: '_vwscanf_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(788): warning C4514: 'vwscanf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(801): warning C4514: '_vwscanf_s_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(817): warning C4514: 'vwscanf_s': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(832): warning C4514: '_fwscanf_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(851): warning C4514: 'fwscanf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(869): warning C4514: '_fwscanf_s_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(890): warning C4514: 'fwscanf_s': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(910): warning C4514: '_wscanf_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(928): warning C4514: 'wscanf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(945): warning C4514: '_wscanf_s_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(965): warning C4514: 'wscanf_s': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1092): warning C4514: '_vsnwprintf_s': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1120): warning C4514: '_vsnwprintf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1169): warning C4514: '_vswprintf_c': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1221): warning C4514: '_vswprintf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1274): warning C4514: 'vswprintf_s': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1321): warning C4514: '_vswprintf_p': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1356): warning C4514: '_vscwprintf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1389): warning C4514: '_vscwprintf_p': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1403): warning C4514: '__swprintf_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1423): warning C4514: '_swprintf_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1444): warning C4514: '_swprintf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1463): warning C4514: 'swprintf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1506): warning C4514: '_swprintf_s_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1528): warning C4514: 'swprintf_s': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1557): warning C4514: '_swprintf_p_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1578): warning C4514: '_swprintf_p': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1598): warning C4514: '_swprintf_c_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1619): warning C4514: '_swprintf_c': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1639): warning C4514: '_snwprintf_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1665): warning C4514: '_snwprintf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1690): warning C4514: '_snwprintf_s_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1712): warning C4514: '_snwprintf_s': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1740): warning C4514: '_scwprintf_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1759): warning C4514: '_scwprintf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1777): warning C4514: '_scwprintf_p_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1796): warning C4514: '_scwprintf_p': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1820): warning C4514: 'swprintf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1835): warning C4514: 'vswprintf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1846): warning C4514: '_swprintf_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1861): warning C4514: '_vswprintf_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1919): warning C4514: 'vswscanf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(1954): warning C4514: 'vswscanf_s': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(2017): warning C4514: '_swscanf_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(2037): warning C4514: 'swscanf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(2056): warning C4514: '_swscanf_s_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(2078): warning C4514: 'swscanf_s': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(2099): warning C4514: '_snwscanf_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(2125): warning C4514: '_snwscanf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(2150): warning C4514: '_snwscanf_s_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_wstdio.h(2171): warning C4514: '_snwscanf_s': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(644): warning C4514: 'vfprintf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(675): warning C4514: 'vfprintf_s': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(706): warning C4514: '_vfprintf_p': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(720): warning C4514: '_vprintf_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(734): warning C4514: 'vprintf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(747): warning C4514: '_vprintf_s_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(763): warning C4514: 'vprintf_s': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(778): warning C4514: '_vprintf_p_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(792): warning C4514: '_vprintf_p': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(805): warning C4514: '_fprintf_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(824): warning C4514: 'fprintf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(848): warning C4514: '_fprintf_s_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(869): warning C4514: 'fprintf_s': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(889): warning C4514: '_fprintf_p_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(908): warning C4514: '_fprintf_p': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(926): warning C4514: '_printf_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(944): warning C4514: 'printf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(961): warning C4514: '_printf_s_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(981): warning C4514: 'printf_s': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1000): warning C4514: '_printf_p_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1018): warning C4514: '_printf_p': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1066): warning C4514: 'vfscanf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1100): warning C4514: 'vfscanf_s': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1116): warning C4514: '_vscanf_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1130): warning C4514: 'vscanf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1143): warning C4514: '_vscanf_s_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1159): warning C4514: 'vscanf_s': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1174): warning C4514: '_fscanf_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1193): warning C4514: 'fscanf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1211): warning C4514: '_fscanf_s_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1232): warning C4514: 'fscanf_s': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1252): warning C4514: '_scanf_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1270): warning C4514: 'scanf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1287): warning C4514: '_scanf_s_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1307): warning C4514: 'scanf_s': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1465): warning C4514: 'vsprintf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1506): warning C4514: 'vsprintf_s': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1553): warning C4514: '_vsprintf_p': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1591): warning C4514: '_vsnprintf_s': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1619): warning C4514: 'vsnprintf_s': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1664): warning C4514: '_vscprintf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1729): warning C4514: '_vsnprintf_c': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1744): warning C4514: '_sprintf_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1769): warning C4514: 'sprintf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1803): warning C4514: '_sprintf_s_l': unreferenced inline function has been removed
1>..\..\Test002.cpp(25): warning C4710: 'int sprintf_s(char *const ,const std::size_t,const char *const ,...)': function not inlined
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1826): note: see declaration of 'sprintf_s'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1854): warning C4514: '_sprintf_p_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1875): warning C4514: '_sprintf_p': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1895): warning C4514: '_snprintf_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1932): warning C4514: 'snprintf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1952): warning C4514: '_snprintf': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1982): warning C4514: '_snprintf_c_l': unreferenced inline function has been removed
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(2003): warning C4514: '_snprintf_c': unreferenced inline function has been removed

W4 is probably good 
https://msdn.microsoft.com/en-us/librar ... 68(v=vs.60).aspx
Last edited by Cuchulainn on January 10th, 2018, 4:27 pm
 
User avatar
outrun
Posts: 4573
Joined: April 29th, 2016, 1:40 pm

Re: Stupid question of the day

January 10th, 2018, 4:26 pm

katastrofa wrote:
Thanks, I was just surprised that the compiler didn't give me any warning. I get confused by VS sometimes.

Yes I can imagine, but since it's valid standard C++ the compiler can't give an error. Whether or not it should give a warning is a subjective, and it will vary between compilers. Maybe it should.. 
 
User avatar
Cuchulainn
Posts: 56926
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Re: Stupid question of the day

January 10th, 2018, 4:34 pm

outrun wrote:
katastrofa wrote:
Thanks, I was just surprised that the compiler didn't give me any warning. I get confused by VS sometimes.

Yes I can imagine, but since it's valid standard C++ the compiler can't give an error. Whether or not it should give a warning is a subjective, and it will vary between compilers. Maybe it should.. 

I can't see any flag ANON objects in the settings
return C();
return std::vector<int>(100);
All anon and good to use.
 
User avatar
outrun
Posts: 4573
Joined: April 29th, 2016, 1:40 pm

Re: Stupid question of the day

January 10th, 2018, 4:49 pm

Cuchulainn wrote:
outrun wrote:
katastrofa wrote:
Thanks, I was just surprised that the compiler didn't give me any warning. I get confused by VS sometimes.

Yes I can imagine, but since it's valid standard C++ the compiler can't give an error. Whether or not it should give a warning is a subjective, and it will vary between compilers. Maybe it should.. 

I can't see any flag ANON objects in the settings
return C();
return std::vector<int>(100);
All anon and good to use.

that's different from what K did, returning an object is very common
 
User avatar
Cuchulainn
Posts: 56926
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Re: Stupid question of the day

January 10th, 2018, 5:30 pm

outrun wrote:
int main() {
//   f();
   C();
   C();
   C();


}


outrun:
Cuchulainn wrote:
outrun wrote:
Yes I can imagine, but since it's valid standard C++ the compiler can't give an error. Whether or not it should give a warning is a subjective, and it will vary between compilers. Maybe it should.. 

I can't see any flag ANON objects in the settings
return C();
return std::vector<int>(100);
All anon and good to use.

that's different from what K did, returning an object is very common

Slightly different. It's still an ANON obj. 
 
User avatar
outrun
Posts: 4573
Joined: April 29th, 2016, 1:40 pm

Re: Stupid question of the day

January 10th, 2018, 6:40 pm

Cuchulainn wrote:
outrun wrote:
int main() {
//   f();
   C();
   C();
   C();


}


outrun:
Cuchulainn wrote:
I can't see any flag ANON objects in the settings
return C();
return std::vector<int>(100);
All anon and good to use.

that's different from what K did, returning an object is very common

Slightly different. It's still an ANON obj. 

It's still "many things", but it's important to learn to be precise. The lack of scope is what what makes it a warning candidate. Returning objects isn't strange, that a very normal thing to do.

I don't think anyone would post a fragments that returns an objects and comment "hey look at this, I didnt get a warning?!".
 
User avatar
katastrofa
Posts: 6281
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

Re: Stupid question of the day

January 10th, 2018, 7:13 pm

I actually sort of did exactly that :-D That's what happens to people who just apply and aren't trained in the field, right?
 
User avatar
outrun
Posts: 4573
Joined: April 29th, 2016, 1:40 pm

Re: Stupid question of the day

January 10th, 2018, 9:39 pm

katastrofa wrote:
I actually sort of did exactly that :-D That's what happens to people who just apply and aren't trained in the field, right?

No! The best training is to be applied: have to deal with solving real world problems, ..and if you want good training on programming then there is so much high quality resources you can locate with quick google (and they are really worthwhile to study,.. if you are into that sort of thing).

Mrs outrun and I used to play computer games against each other on our LAN (Red Alert was one of out favourite, but Duke Nuke 'm, Half Life were a lot of fun too). Whenever there was a new game she would start clicking as a maniac all over the screen and before you know it she would get semi-organised and release endless mayhem on me. Like a piranha.. My survival strategy was to try and find a manual somewhere, or else iterate every key combination and make notes, pre-compute probability tables of optimal strategies when applicable (e.g. in Risk: attack or defend?).. and then slooowly we would even out. I would have my occasional laugh with a special hidden feature, but I could only use it once. 
..both methods of learning new games/skills worked really well, but I now know Mrs Outrun was doing applied Reinforcement Learning, and that's the way to go!
 
User avatar
Cuchulainn
Posts: 56926
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Re: Stupid question of the day

January 11th, 2018, 10:00 am

outrun wrote:
Cuchulainn wrote:
outrun wrote:
Yes I can imagine, but since it's valid standard C++ the compiler can't give an error. Whether or not it should give a warning is a subjective, and it will vary between compilers. Maybe it should.. 

I can't see any flag ANON objects in the settings
return C();
return std::vector<int>(100);
All anon and good to use.

that's different from what K did, returning an object is very common

Image
 
User avatar
Cuchulainn
Posts: 56926
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Re: Stupid question of the day

January 11th, 2018, 9:13 pm

katastrofa wrote:
I actually sort of did exactly that :-D That's what happens to people who just apply and aren't trained in the field, right?

It is possible to learn by osmosis (aka google).
 
User avatar
Paul
Posts: 8589
Joined: July 20th, 2001, 3:28 pm

Re: Stupid question of the day

January 12th, 2018, 9:26 pm

When you need your iPhone to be silent you turn off the ringer...and it immediately buzzes. When it doesn’t need to be silent you turn it back on...and it makes no sound. Why, oh why?
 
User avatar
outrun
Posts: 4573
Joined: April 29th, 2016, 1:40 pm

Re: Stupid question of the day

January 12th, 2018, 9:35 pm

Does it do the buzz during silencing after you first disable "vibrate on silent"?

http://devicehelp.optus.com.au/apple/ip ... on-or-off/

I think it's telling you "I'm not completely silent now, vibration is still on"
ABOUT WILMOTT

PW by JB

Wilmott.com has been "Serving the Quantitative Finance Community" since 2001. Continued...


JOBS BOARD

JOBS BOARD

Looking for a quant job, risk, algo trading,...? Browse jobs here...