473,326 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Unknown Compiler Warning

Hi All,

I was wonder if somebody could tell me about this warning, as I have
written a fairly large application and I am gettting lots and lots of
these warning. I have no real clue what they mean and how to get rid of them

C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xlocale(609) : warning C4100: '_Lobj' : unreferenced
formal parameter

Any help would be much appreciated,

Adam
Mar 9 '06 #1
12 4428
Adam Hartshorne wrote:
I was wonder if somebody could tell me about this warning, as I have
written a fairly large application and I am gettting lots and lots of
these warning. I have no real clue what they mean and how to get rid of
them

C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xlocale(609) : warning C4100: '_Lobj' : unreferenced
formal parameter

Any help would be much appreciated,


This is the last time I will do this: put your cursor on the 'C4100' thing
in the "Build" window and press F1. Enjoy the online help provided to you
by your product. Alternatively, go to "Help" and search for 'C4100'.

The usual "Unused formal argument" comes from compiling a function that
declares an argument _with_ a name and never uses it:

int foo(double d) {
return 42; // 'd' is not used here
}

V
--
Please remove capital As from my address when replying by mail
Mar 9 '06 #2
Adam Hartshorne wrote:
Hi All,

I was wonder if somebody could tell me about this warning, as I have
written a fairly large application and I am gettting lots and lots of
these warning. I have no real clue what they mean and how to get rid
of them

C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xlocale(609) : warning C4100: '_Lobj' : unreferenced
formal parameter

Any help would be much appreciated,


It's difficult to say, because you (I guess) assume that we can
psychically look at your code. However, that's usually a warning when a
formal parameter isn't referenced.

If that doesn't help, read the FAQ about how to post a proper question.

Brian
Mar 9 '06 #3
Adam Hartshorne wrote:
Hi All,

I was wonder if somebody could tell me about this warning, as I have
written a fairly large application and I am gettting lots and lots of
these warning. I have no real clue what they mean and how to get rid of
them

C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xlocale(609) : warning C4100: '_Lobj' : unreferenced
formal parameter


Turn off the warning.

It gets generated for code like this:

int f(int i)
{
return 1;
}

There's nothing wrong with that code. Sometimes you need extra arguments
for consistency with other functions, even if those arguments aren't
used in some cases.

A trick that usually silences this warning is to use the argument in
some trivial way:

int f(int i)
{
i = i;
return 1;
}

Now the argument is used. Of course, you might get a warning that the
code has no effect, and you then have to write something to quiet that
warning. You can play this game for hours if you like. Or you can turn
off stupid warnings and get on with real work.

Most C++ compilers won't give this warning if you don't give the
argument a name, but that trick won't work if your code also has to
compile as C, because C requires a name there.

--

Pete Becker
Roundhouse Consulting, Ltd.
Mar 9 '06 #4
Pete Becker wrote:
Adam Hartshorne wrote:
Hi All,

I was wonder if somebody could tell me about this warning, as I have
written a fairly large application and I am gettting lots and lots of
these warning. I have no real clue what they mean and how to get rid
of them

C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xlocale(609) : warning C4100: '_Lobj' : unreferenced
formal parameter


Turn off the warning.

It gets generated for code like this:

int f(int i)
{
return 1;
}

There's nothing wrong with that code. Sometimes you need extra arguments
for consistency with other functions, even if those arguments aren't
used in some cases.

A trick that usually silences this warning is to use the argument in
some trivial way:

int f(int i)
{
i = i;
return 1;
}

Now the argument is used. Of course, you might get a warning that the
code has no effect, and you then have to write something to quiet that
warning. You can play this game for hours if you like. Or you can turn
off stupid warnings and get on with real work.

Most C++ compilers won't give this warning if you don't give the
argument a name, but that trick won't work if your code also has to
compile as C, because C requires a name there.


Ok I understand what you are saying. However I haven't intensionally
used xlocale, i don't even know what it does.

Adam
Mar 9 '06 #5
Pete Becker wrote:
Adam Hartshorne wrote:
Hi All,

I was wonder if somebody could tell me about this warning, as I have
written a fairly large application and I am gettting lots and lots of
these warning. I have no real clue what they mean and how to get rid
of them

C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xlocale(609) : warning C4100: '_Lobj' : unreferenced
formal parameter


Turn off the warning.

It gets generated for code like this:

int f(int i)
{
return 1;
}

There's nothing wrong with that code. Sometimes you need extra arguments
for consistency with other functions, even if those arguments aren't
used in some cases.

A trick that usually silences this warning is to use the argument in
some trivial way:

int f(int i)
{
i = i;
return 1;
}

Now the argument is used. Of course, you might get a warning that the
code has no effect, and you then have to write something to quiet that
warning. You can play this game for hours if you like. Or you can turn
off stupid warnings and get on with real work.

Most C++ compilers won't give this warning if you don't give the
argument a name, but that trick won't work if your code also has to
compile as C, because C requires a name there.


Thanks for the answer, I had kind of guess that, but I don't
intensionally use xlocale, I don't even know what it does.

Adam
Mar 9 '06 #6
* Adam Hartshorne:

I was wonder if somebody could tell me about this warning, as I have
written a fairly large application and I am gettting lots and lots of
these warning. I have no real clue what they mean and how to get rid of
them

C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xlocale(609) : warning C4100: '_Lobj' : unreferenced
formal parameter

Any help would be much appreciated,


Since the warning is generated for code in the standard library, I think
the best advice is what Pete Becker wrote, to turn off that warning.

Such warnings are known as 'silly-warnings', and the compiler you're
using spews out so indecently many of them that the same firm has a
habit of listing all the #pragma's that turn them off, in some central
place in their code.

For your own code, simply don't name an unreferenced formal argument.
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Mar 9 '06 #7
Adam Hartshorne wrote:

Ok I understand what you are saying. However I haven't intensionally
used xlocale, i don't even know what it does.


I know. I was ranting about stupid warnings. This is one you should just
turn off.

--

Pete Becker
Roundhouse Consulting, Ltd.
Mar 9 '06 #8
Pete Becker wrote:
Adam Hartshorne wrote:

Ok I understand what you are saying. However I haven't intensionally
used xlocale, i don't even know what it does.


I know. I was ranting about stupid warnings. This is one you should just
turn off.


How do I turn it off?

Adam
Mar 9 '06 #9
Adam Hartshorne wrote:

How do I turn it off?


I think it's

#pragma warning(disable: 4100)

but you should look it up.

--

Pete Becker
Roundhouse Consulting, Ltd.
Mar 9 '06 #10
Pete Becker wrote:
Adam Hartshorne wrote:
Hi All,

I was wonder if somebody could tell me about this warning, as I have
written a fairly large application and I am gettting lots and lots of
these warning. I have no real clue what they mean and how to get rid
of them

C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xlocale(609) : warning C4100: '_Lobj' : unreferenced
formal parameter


Turn off the warning.

It gets generated for code like this:

int f(int i)
{
return 1;
}

There's nothing wrong with that code. Sometimes you need extra arguments
for consistency with other functions, even if those arguments aren't
used in some cases.

A trick that usually silences this warning is to use the argument in
some trivial way:

int f(int i)
{
i = i;
return 1;
}


I think the warning will disappear if you do

int f(int /*i*/)
{
return 1;
}
Mar 10 '06 #11
Martin Vejnar wrote:
Pete Becker wrote:
Adam Hartshorne wrote:
Hi All,

I was wonder if somebody could tell me about this warning, as I have
written a fairly large application and I am gettting lots and lots of
these warning. I have no real clue what they mean and how to get rid
of them

C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xlocale(609) : warning C4100: '_Lobj' : unreferenced
formal parameter


Turn off the warning.

It gets generated for code like this:

int f(int i)
{
return 1;
}

There's nothing wrong with that code. Sometimes you need extra
arguments for consistency with other functions, even if those
arguments aren't used in some cases.

A trick that usually silences this warning is to use the argument in
some trivial way:

int f(int i)
{
i = i;
return 1;
}


I think the warning will disappear if you do

int f(int /*i*/)
{
return 1;
}


AS I have mentioned before I can't / don't want to do this as the
warning is coming from xlocale, a header file which is built in to
visual studio and one which i have not altered or directly referenced!!!!

Adam
Mar 10 '06 #12
Adam Hartshorne wrote:
Martin Vejnar wrote:
Pete Becker wrote:
Adam Hartshorne wrote:

[snip]

C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xlocale(609) : warning C4100: '_Lobj' :
unreferenced formal parameter

[snip]


I think the warning will disappear if you do

int f(int /*i*/)
{
return 1;
}


AS I have mentioned before I can't / don't want to do this as the
warning is coming from xlocale, a header file which is built in to
visual studio and one which i have not altered or directly referenced!!!!


When it comes to VS2003 I cannot say for sure, but on VS2005 the
<xlocale> header is referenced through multiple levels of indirection
from, for example, <iostream>. I'd say that the same thing is happening
to you.

Why are you worried about fixing a buggy (inconvenient) header file?

There is '/wd' option for compiler that can be used to disable specific
warnings.
Mar 10 '06 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: BigMan | last post by:
Should a compiler (according to the C++ standard) issue a warning (or other kind of diagnostic message) when it encounters an unknown pragma directive?
8
by: Spartanicus | last post by:
The document at http://homepage.ntlworld.com/spartanicus/custom_dtd.htm uses a custom DTD, the w3c validator validates it but with this warning: "Unknown Parse Mode! The MIME Media Type...
9
by: Christian Christmann | last post by:
Hi, I was just going through this exercise http://www.cas.mcmaster.ca/~franek/books/membook-answers/ch4/answers-ch4-3.html and I'am confused about the answer. It says: "... the compiler...
0
by: Shaun | last post by:
Hi all, I'm trying to implement a custom session handler that writes session data to a MySQL database. It works fine about 99% of the time. Trouble is, at random intervals, I get entries like...
9
by: Klaus Johannes Rusch | last post by:
IE7 returns "unknown" instead of "undefined" when querying the type of an unknown property of an object, for example document.write(typeof window.missingproperty); Has "unknown" been defined...
6
by: delusion7 | last post by:
I keep getting this error and/or similar errors. I am very new to mysql and php. "PHP Warning: Unknown(): Unable to load dynamic library './php_mysqli.dll' - The specified module could not be...
111
by: Tonio Cartonio | last post by:
I have to read characters from stdin and save them in a string. The problem is that I don't know how much characters will be read. Francesco -- ------------------------------------- ...
2
by: Charles Zhang | last post by:
I used Visual Studio 2005 to create a "Windows Installer Package". When I ran the package on a Windows XP computer, I got a warning -- "Unknown publisher". My question is: what steps do I need...
33
by: Adam Chapman | last post by:
Hi, Im trying to migrate from programming in Matlab over to C. Im trying to make a simple function to multiply one matrix by the other. I've realised that C can't determine the size of a 2d...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.