By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,241 Members | 760 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,241 IT Pros & Developers. It's quick & easy.

Compilation Error/Warning - Help

P: n/a
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<-----------------------

Jul 23 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Raja Koduru wrote:
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.

--

Pete Becker
Dinkumware, Ltd. (http://www.dinkumware.com)
Jul 23 '05 #2

P: n/a
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

Jul 23 '05 #3

P: n/a
Raja Koduru wrote:

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.

--

Pete Becker
Dinkumware, Ltd. (http://www.dinkumware.com)
Jul 23 '05 #4

P: n/a
Thank you Pete Becker. That gives me direction to pursue further.

Jul 23 '05 #5

P: n/a
On 16 Feb 2005 07:53:16 -0800, Raja Koduru
<ks*****@gmail.com> wrote:
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
Jul 23 '05 #6

P: n/a
Thanks chris. I using pragma warning disable feature on file by file
basis.

Jul 23 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.