Compilation Error/Warning - Help

R

Raja Koduru

Hello everybody,

I am not yet fully comfortable with understanding c++ warnings/error
messages. Very recently I have updated my IDE to VC++7.0 (MS.Net
7.0-Enterprise architect) from vc++6. Initially the same code used to
compile without any messages. Now the following warning/error messages
are appearing.

I don't think this it is related some source code of mine. Otherwise I
would have pasted the my code here.

Feel like it some kind of configuration tweak is necessary to my
Makefile. The same messages are appearing for all my *.cpp files.
Can you give me a hint on why these are appearing? and how to resolve
it.

regards,
Raja Koduru
---------------------->message chunk<-----------------------
cl -c -nologo -Zm200 -EHsc -W3 -w34100 -w34189 -MDd -Zi -Gm -GX -GX -GR
-DWIN32 -DQT_DLL -DQT_THREAD_SUPPORT -I"."
-I"..\..\..\Libraries\_BuildSystem_\
Include" -I"..\..\LibQtSkin\Include" -I"ui" -I"src"
-I"g:\projects\rediff\TMixerLib\src" -I"G:\Qt\3.3.4\include"
-I"ui\include" -I"." -I"moc" -I"G:\Qt\3.3.4\mkspecs\win32-msvc.net"
-Foobj\ @e:\temp\nm23.tmp RASWizard.cpp
D:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xlocale(609) : wa
rning C4100: '_Lobj' : unreferenced formal parameter
D:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xlocale(6
10) : while compiling class-template member function 'void
std::codecvt<_Elem,_B
yte,_Statype>::_Init(const std::_Locinfo &)'
with
[
_Elem=char,
_Byte=char,
_Statype=mbstate_t
]
D:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xlocale(1
560) : see reference to class template instantiation
'std::codecvt<_Elem,_Byte,_
Statype>' being compiled
with
[
_Elem=char,
_Byte=char,
_Statype=mbstate_t
]
---------------------->message chunk<-----------------------
 
P

Pete Becker

Raja said:
D:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xlocale(609) : wa
rning C4100: '_Lobj' : unreferenced formal parameter
D:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xlocale(6
10)

If you look in the vicinity of line 610 in the header <xlocale> you'll
see this:

void _Init(const _Locinfo& _Lobj)
{ // initialize from _Lobj
}

So the compiler is, in fact, correct that _Lobj is not used. If that
bothers you, edit the header and remove _Lobj. Or just turn off this
warning.
 
R

Raja Koduru

Pete Becker,

You are correct. Thank you. I now understand why it is reporting so. I
very much want to disable such errors from standard headers. But I
don't want to edit those standard headers. I would prefer to stitch
configurations at my end.

Please suggest me on how to disable only this particular warning, very
specific to this file(s). I don't want to disable the whole of C4100.
Because if I am making any such mistakes in my code this(C4100) warning
will give me a chance to correct it.

Correct me if my request sounds absurd.

regards,
raja koduru
 
P

Pete Becker

Raja said:
You are correct. Thank you. I now understand why it is reporting so. I
very much want to disable such errors from standard headers. But I
don't want to edit those standard headers. I would prefer to stitch
configurations at my end.

Please suggest me on how to disable only this particular warning, very
specific to this file(s). I don't want to disable the whole of C4100.
Because if I am making any such mistakes in my code this(C4100) warning
will give me a chance to correct it.

Correct me if my request sounds absurd.

It's not absurd, just, in my view, a bit misguided. You've hit on one of
my pet peeves, so don't take any of this paragraph personally. <g>
There's nothing wrong with a function not using some of its arguments.
It's sometimes necessary, in order to provide a rich interface that
doesn't happen to be needed in a particular class, but is needed in, for
example, derived classes. Busybody compilers can usually be quieted by
leaving out the argument name, but that's not legal in C, so it's not a
general solution. Unfortunately, there's a growing trend to let
compilers dictate style rules in the form of warnings for whatever
valid, unambiguous constructs the compiler writer thinks might be misused.

As to suppressing it for that header, you're asking a compiler-specific
question, which is technically out of bounds in this newsgroup. But
generally speaking you can disable some warnings before including a
header and re-enable them afterwards, and sometimes that disabled status
will stick to the things that were defined in the header.
 
C

Chris Croughton

You are correct. Thank you. I now understand why it is reporting so. I
very much want to disable such errors from standard headers. But I
don't want to edit those standard headers. I would prefer to stitch
configurations at my end.

Microsoft's headers are full of warnings, and most of them seem to be
not possible to disable without disabling warnings altogether.
Please suggest me on how to disable only this particular warning, very
specific to this file(s). I don't want to disable the whole of C4100.
Because if I am making any such mistakes in my code this(C4100) warning
will give me a chance to correct it.

Exactly. Does that version of the compiler have a #pragma which can be
used to turn off warnings only around the headers in your code?
Correct me if my request sounds absurd.

It's not absurd. Microsoft (or anyone else) releasing standard headers
which produce warnings is absurd...

Chris C
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top