C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Visual Studio and ISO C++ Names
Goto page 1, 2  Next
 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language, library and standards
View previous topic :: View next topic  
Author Message
Tom Einertson
Guest





PostPosted: Sat Jan 28, 2006 12:16 pm    Post subject: Visual Studio and ISO C++ Names Reply with quote



Some of the code we write at my company runs on both UNIX systems
(mostly AIX) and Microsoft Windows systems. The code which was
originally written on UNIX contains a number of Posix function calls,
many of which compile and execute properly on Windows. We have
recently begun using the Microsoft Visual Studio .net 2005 compiler and
we now getting the following warning message about a number of Posix
calls.

..\wuu.c(790) : warning C4996: 'unlink' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(290) :
see declaration of 'unlink'
Message: 'The POSIX name for this item is deprecated. Instead, use
the ISO C++ conformant name: _unlink. See online help for details.'

Does anyone know what the reason for this is? I've read every C and
C++ book I own and searched the internet trying to find an explanation
for this change. For the life of me, I can't see how "_unlink" is any
more ISO C++ conformant than "unlink".

PS - Even after reading the charter of several newsgroups it wasn't
clear to me where a question like this belongs, so I cross-posted this
to a Windows newsgroup, figuring perhaps people there have heard an
explanation from Microsoft which I missed, and a C++ and UNIX
newsgroup, figuring you might have some insight on the issue of ISO C++
and Posix names. If there are more relevant groups, please redirect
the discussion as you see fit.

--
Tom Einertson E-mail: tome@siemens-emis.com
SIEMENS Power Transmission & Distribution Phone: (952) 607-2244
Energy Management & Automation Division Fax: (952) 607-2018
10900 Wayzata Boulevard, Suite 400
Minnetonka, MN, 55305



---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Back to top
Dilip
Guest





PostPosted: Sat Jan 28, 2006 4:49 pm    Post subject: Re: Visual Studio and ISO C++ Names Reply with quote



"Tom Einertson" wrote:
Quote:
Some of the code we write at my company runs on both UNIX systems
(mostly AIX) and Microsoft Windows systems. The code which was
originally written on UNIX contains a number of Posix function calls,
many of which compile and execute properly on Windows. We have
recently begun using the Microsoft Visual Studio .net 2005 compiler and
we now getting the following warning message about a number of Posix
calls.

.\wuu.c(790) : warning C4996: 'unlink' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(290) :
see declaration of 'unlink'
Message: 'The POSIX name for this item is deprecated. Instead, use
the ISO C++ conformant name: _unlink. See online help for details.'

This is definitely confusing. A few months ago a similar thread
started in c.l.c++.m. Here is a link to it:
http://groups.google.com/group/comp.lang.c++.moderated/msg/aeaf2aac72aa1312

Not sure if its the same thing though.

---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Back to top
P.J. Plauger
Guest





PostPosted: Sat Jan 28, 2006 5:00 pm    Post subject: Re: Visual Studio and ISO C++ Names Reply with quote



""Tom Einertson"" <tome@siemens-emis.com> wrote in message
news:YMqdnenWtqO8n0beRVn-iQ (AT) comcast (DOT) com...

Quote:
Some of the code we write at my company runs on both UNIX systems
(mostly AIX) and Microsoft Windows systems. The code which was
originally written on UNIX contains a number of Posix function calls,
many of which compile and execute properly on Windows. We have
recently begun using the Microsoft Visual Studio .net 2005 compiler and
we now getting the following warning message about a number of Posix
calls.

.\wuu.c(790) : warning C4996: 'unlink' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(290)
:
see declaration of 'unlink'
Message: 'The POSIX name for this item is deprecated. Instead, use
the ISO C++ conformant name: _unlink. See online help for details.'

Does anyone know what the reason for this is?

Microsoft decided to add a whole slew of new warnings with V8 (VC++
2005). They've taken no small amount of heat for using the phrase
"declared deprecated" since a) "deprecated" is a term of art from
ISO standards, and b) Microsoft is doing the deprecating here, not
ISO. Your best bet is probably to make it standard practice to
disable this warning for all compiles.

In any event, unlink is a perfectly fine function to call in a
combined Standard C/Posix environment. It's not okay in Standard
C alone, but you probably don't care about that.

Quote:
I've read every C and
C++ book I own and searched the internet trying to find an explanation
for this change. For the life of me, I can't see how "_unlink" is any
more ISO C++ conformant than "unlink".

Both Standard C and Standard C++ let the implementation define
external symbols with a leading underscore, as conforming
extensions. But "unlink" invades the space of names reserved
to the programmer.

HTH,

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com


---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Back to top
Jerry Coffin
Guest





PostPosted: Sat Jan 28, 2006 5:24 pm    Post subject: Re: Visual Studio and ISO C++ Names Reply with quote

"Tom Einertson" wrote:

[ ... ]

Quote:
Does anyone know what the reason for this is? I've read every C and
C++ book I own and searched the internet trying to find an explanation
for this change. For the life of me, I can't see how "_unlink" is any
more ISO C++ conformant than "unlink".

IMO, this is simply a mistake on MS' part. First of all, this only
matters at all if the name is declared in a header that's defined as
part of the C++ standard in the first place.

Second, if that was the case, it would probably need to become _Unlink
or __unlink (though, of course, variations like un__link are also
possible).

--
Later,
Jerry.

---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Back to top
Guy Harrison
Guest





PostPosted: Sat Jan 28, 2006 10:46 pm    Post subject: Re: Visual Studio and ISO C++ Names Reply with quote

Tom Einertson wrote:

Quote:
Some of the code we write at my company runs on both UNIX systems
(mostly AIX) and Microsoft Windows systems. The code which was
originally written on UNIX contains a number of Posix function calls,
many of which compile and execute properly on Windows. We have
recently begun using the Microsoft Visual Studio .net 2005 compiler and
we now getting the following warning message about a number of Posix
calls.

.\wuu.c(790) : warning C4996: 'unlink' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(290)
:
see declaration of 'unlink'
Message: 'The POSIX name for this item is deprecated. Instead, use
the ISO C++ conformant name: _unlink. See online help for details.'

Strictly speaking I guess this is correct, albeit typical misleading M$
waffle. "unlink" is may be depreciated (it never could work under windoze)
but iirc the language states leading underscores are reserved for the
implementation.

Quote:
Does anyone know what the reason for this is? I've read every C and
C++ book I own and searched the internet trying to find an explanation
for this change. For the life of me, I can't see how "_unlink" is any
more ISO C++ conformant than "unlink".

You can likely replace "unlink" with "remove" (or std::remove). The
semantics are different however - *nix can unlink a file which is open
whereas windoze cannot. Under unix a file/folder is trashed when the last
process with a handle to it, dies. Think tempfiles...

//create file
//unlink
//carry on accessing it
//(process dies, kernel removes file from disk if last handle

..whereas windoze will barf.

Quote:
PS - Even after reading the charter of several newsgroups it wasn't
clear to me where a question like this belongs, so I cross-posted this
to a Windows newsgroup, figuring perhaps people there have heard an
explanation from Microsoft which I missed, and a C++ and UNIX
newsgroup, figuring you might have some insight on the issue of ISO C++
and Posix names. If there are more relevant groups, please redirect
the discussion as you see fit.

Any generic group will suffice - look for "inode" references in manuals.

---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Back to top
Tom Einertson
Guest





PostPosted: Sat Jan 28, 2006 11:00 pm    Post subject: Re: Visual Studio and ISO C++ Names Reply with quote

""P.J. Plauger"" <pjp (AT) dinkumware (DOT) com> wrote in message
news:tq2dnc2pUadY5EbeRVn-tw (AT) giganews (DOT) com...

Quote:
Microsoft decided to add a whole slew of new warnings with V8 (VC++
2005). They've taken no small amount of heat for using the phrase
"declared deprecated" since a) "deprecated" is a term of art from
ISO standards, and b) Microsoft is doing the deprecating here, not
ISO. Your best bet is probably to make it standard practice to
disable this warning for all compiles.

I don't fault them for using the term deprecated, just in trying to
blame it on ISO C++. If Microsoft decides they might not support some
interface in the future that's up to them. But the error message seems
to imply that they were forced to do this in order to become C++
conformant.

Quote:
In any event, unlink is a perfectly fine function to call in a
combined Standard C/Posix environment. It's not okay in Standard
C alone, but you probably don't care about that.

Both Standard C and Standard C++ let the implementation define
external symbols with a leading underscore, as conforming
extensions. But "unlink" invades the space of names reserved
to the programmer.

It's clear that as the supplier of the compiler Microsoft has the
option to use names beginning with an underscore for conforming
extensions. But "unlink" is an operating system interface, and there
has always been overlap between the names assigned for operating system
interfaces and user programs.

I can't find anything, though, that REQUIRES Microsoft to use leading
underscores in the names of operating system interfaces. I also notice
that they only declared Posix names without leading underscores to be
non-conformant. We don't get errors saying that Microsoft Win32 system
interfaces such as CreateFile needs to be named _CreateFile in order to
be ISO C++ conformant.

--
Tom Einertson E-mail: tome@siemens-emis.com
SIEMENS Power Transmission & Distribution Phone: (952) 607-2244
Energy Management & Automation Division Fax: (952) 607-2018
10900 Wayzata Boulevard, Suite 400
Minnetonka, MN, 55305



---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Back to top
Rob Williscroft
Guest





PostPosted: Sun Jan 29, 2006 4:00 pm    Post subject: Re: Visual Studio and ISO C++ Names Reply with quote

Jerry Coffin wrote in news:1138443947.035791.316900
@g47g2000cwa.googlegroups.com in comp.std.c++:

Quote:
"Tom Einertson" wrote:

[ ... ]

Does anyone know what the reason for this is? I've read every C and
C++ book I own and searched the internet trying to find an explanation
for this change. For the life of me, I can't see how "_unlink" is any
more ISO C++ conformant than "unlink".

IMO, this is simply a mistake on MS' part. First of all, this only
matters at all if the name is declared in a header that's defined as
part of the C++ standard in the first place.

It's defined in stdio.h, so this is the case here.

Quote:

Second, if that was the case, it would probably need to become _Unlink
or __unlink (though, of course, variations like un__link are also
possible).


Names begining with a single underscore are reserved for the
implementation in the global namespace, so Microsoft are moving
::unlink to the implementations reserved set of names by
prepending a single underscore, or in there words making it an
"ISO C++ conformant name".

This program will produce the warning:

#include <cstdio>

int main()
{
unlink( "c:\\please-delete-me.txt" );
}

But I only get the warning if use unlink(), So (IMO) this
warning is useful as its telling me my programme won't
compile under the next version of VC++.

Rob.
--
http://www.victim-prime.dsl.pipex.com/

---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Back to top
Guest






PostPosted: Sun Jan 29, 2006 7:10 pm    Post subject: Re: Visual Studio and ISO C++ Names Reply with quote

"P.J. Plauger" wrote:

Quote:
""Tom Einertson"" <tome@siemens-emis.com> wrote in message
news:YMqdnenWtqO8n0beRVn-iQ (AT) comcast (DOT) com...

I've read every C and
C++ book I own and searched the internet trying to find an explanation
for this change. For the life of me, I can't see how "_unlink" is any
more ISO C++ conformant than "unlink".

Both Standard C and Standard C++ let the implementation define
external symbols with a leading underscore, as conforming
extensions. But "unlink" invades the space of names reserved
to the programmer.

Um, doesn't this say that only an implementor of C++ should use the
name "_unlink" - and that a vendor neutral API would not be ISO
conformant were it to use this name?
--
Alan Griffiths

---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Back to top
Tom Einertson
Guest





PostPosted: Sun Jan 29, 2006 11:00 pm    Post subject: Re: Visual Studio and ISO C++ Names Reply with quote

"Rob Williscroft" <rtw (AT) freenet (DOT) co.uk> wrote in message
news:Xns975A7BE66BEDDrtwfreenetREMOVEcouk (AT) 216 (DOT) 196.109.145...
Quote:
Jerry Coffin wrote in news:1138443947.035791.316900
@g47g2000cwa.googlegroups.com in comp.std.c++:

"Tom Einertson" wrote:

[ ... ]

Does anyone know what the reason for this is? I've read every C and
C++ book I own and searched the internet trying to find an explanation
for this change. For the life of me, I can't see how "_unlink" is any
more ISO C++ conformant than "unlink".

IMO, this is simply a mistake on MS' part. First of all, this only
matters at all if the name is declared in a header that's defined as
part of the C++ standard in the first place.

It's defined in stdio.h, so this is the case here.
...

Names begining with a single underscore are reserved for the
implementation in the global namespace, so Microsoft are moving
::unlink to the implementations reserved set of names by
prepending a single underscore, or in there words making it an
"ISO C++ conformant name".

I didn't realize that Microsoft defined unlink in stdio.h. On most
UNIXes, it is defined in unistd.h. That seems to explain what's going
on here, though. Presumably Microsoft realized that they shouldn't
have non-standard extensions in a standard header file unless the name
began with an underscore, and this was their solution.

Unfortunately they have fixed the problem in the wrong way (or at least
in the most inconvenient way possible for their users). Why didn't
they just move the prototype from stdio.h to a .h file which is not
defined in the C++ standard? Putting it in a file named unistd.h would
seem the obvious choice, since doing so would simplify porting of UNIX
code to Windows. Or instead of moving it immediately to the new file,
they could have defined the prototype in both .h files during the
transition period and used the pre-processor to prevent duplicate
definitions.

Microsoft already went to the work of flagging these functions for
warnings. Instead of warning you change the function name, couldn't
they instead have warned you to #include the correct file if you hadn't
done so? That doesn't seem that difficult to implement and would move
users toward correct usage.

Quote:
But I only get the warning if use unlink(), So (IMO) this
warning is useful as its telling me my programme won't
compile under the next version of VC++.

Normally I wouldn't care about such an issue. I would just change the
name to the one Microsoft wants me to use. Unfortunately in this case
doing so will make the code so it won't compile on UNIX any more. So
what we had before was a harmless non-compliance with the C++ spec.
What we have now is something which will make it more difficult to
maintain a common code base on Windows and UNIX.

--
Tom Einertson E-mail: tome@siemens-emis.com
SIEMENS Power Transmission & Distribution Phone: (952) 607-2244
Energy Management & Automation Division Fax: (952) 607-2018
10900 Wayzata Boulevard, Suite 400
Minnetonka, MN, 55305

Quote:



---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Back to top
Chris Hills
Guest





PostPosted: Mon Jan 30, 2006 4:00 pm    Post subject: Re: Visual Studio and ISO C++ Names Reply with quote

In article <1138443947.035791.316900 (AT) g47g2000cwa (DOT) googlegroups.com>,
Jerry Coffin <jerry.coffin (AT) gmail (DOT) com> writes
Quote:
"Tom Einertson" wrote:

[ ... ]

Does anyone know what the reason for this is? I've read every C and
C++ book I own and searched the internet trying to find an explanation
for this change. For the life of me, I can't see how "_unlink" is any
more ISO C++ conformant than "unlink".

IMO, this is simply a mistake on MS' part.

It's not a mistake....


--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ chris (AT) phaedsys (DOT) org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/



---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Back to top
P.J. Plauger
Guest





PostPosted: Mon Jan 30, 2006 4:00 pm    Post subject: Re: Visual Studio and ISO C++ Names Reply with quote

<devnull (AT) octopull (DOT) demon.co.uk> wrote in message
news:1138546549.729355.195400 (AT) o13g2000cwo (DOT) googlegroups.com...

Quote:
"P.J. Plauger" wrote:

""Tom Einertson"" <tome@siemens-emis.com> wrote in message
news:YMqdnenWtqO8n0beRVn-iQ (AT) comcast (DOT) com...

I've read every C and
C++ book I own and searched the internet trying to find an explanation
for this change. For the life of me, I can't see how "_unlink" is any
more ISO C++ conformant than "unlink".

Both Standard C and Standard C++ let the implementation define
external symbols with a leading underscore, as conforming
extensions. But "unlink" invades the space of names reserved
to the programmer.

Um, doesn't this say that only an implementor of C++ should use the
name "_unlink" - and that a vendor neutral API would not be ISO
conformant were it to use this name?

Basically, yes. I'm the guy who insisted back in 1983 that the space of
names available to a C program be partitioned into:

a) those defined by the implementation for the benefit of the programmer
(such as printf)

b) those reserved to the programmer (such as foo)

c) those reserved to the implementation (such as _unlink)

We knew even then that "the implementation" was too monolithic --
often more than one source supplies bits of the implementation --
but that was the best we could do at the time. Standard C++
has introduced namespaces to help, but they have achieved only
a fraction of their stated goals. (That's what happens when you
standardize a paper tiger.)

In this particular case, Posix supplies a list of category (a) names
(such as unlink) that you should get defined when and only when you
include certain headers. Since the C Standard stole its headers from
Unix, which is the same source as for Posix, some of those headers
overlap historically. Nevertheless, compiler warnings should have
some way of taking into account whether the supported environment
is "pure" Standard C++ (a Platonic ideal) or a mixed C/C++/Posix
environment. The current attempt by Microsoft to help us poor
programmers fails to take that into account. It insists on treating
unlink as a category (b) name, which is myopic.

Still another wrinkle is what to do about category (c) names,
which was the nub of your original question. We implementers are
still in the Bad Old Days where we have to duke it out with
other implementers for the use of the implementation-reserved
space of names. You try adding _unlink and see what happens when
you test under a given compiler. (Just recently, in fact, one of
our larger embedded compiler customers asked us to rename our
macro _POSIX_C_LIB, because Posix insists that all _POSIX* names
are theirs.) But at least that reserves the worst problems to us
Trained Professionals. We just have to get our stories straight.

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com


---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Back to top
Chris Hills
Guest





PostPosted: Mon Jan 30, 2006 4:00 pm    Post subject: Re: Visual Studio and ISO C++ Names Reply with quote

In article <YMqdnenWtqO8n0beRVn-iQ (AT) comcast (DOT) com>, Tom Einertson
<tome@siemens-emis.com> writes
Quote:
Some of the code we write at my company runs on both UNIX systems
(mostly AIX) and Microsoft Windows systems. The code which was
originally written on UNIX contains a number of Posix function calls,
many of which compile and execute properly on Windows. We have
recently begun using the Microsoft Visual Studio .net 2005 compiler and
we now getting the following warning message about a number of Posix
calls.

.\wuu.c(790) : warning C4996: 'unlink' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(290) :
see declaration of 'unlink'
Message: 'The POSIX name for this item is deprecated. Instead, use
the ISO C++ conformant name: _unlink. See online help for details.'

Does anyone know what the reason for this is? I've read every C and
C++ book I own and searched the internet trying to find an explanation
for this change. For the life of me, I can't see how "_unlink" is any
more ISO C++ conformant than "unlink".

All will be explained.
http://www.octopull.demon.co.uk/editorial/OverloadEditorial200601.pdf



--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ chris (AT) phaedsys (DOT) org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/



---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Back to top
Chris Hills
Guest





PostPosted: Mon Jan 30, 2006 8:00 pm    Post subject: Re: Visual Studio and ISO C++ Names Reply with quote

In article <iNGdnTGii-5GpUDeRVn-qA (AT) comcast (DOT) com>, Tom Einertson
<tome@siemens-emis.com> writes
Quote:

Normally I wouldn't care about such an issue. I would just change the
name to the one Microsoft wants me to use. Unfortunately in this case
doing so will make the code so it won't compile on UNIX any more.

I think the reasons for the MS "mistake" are becoming clear.....

Quote:
So
what we had before was a harmless non-compliance with the C++ spec.
What we have now is something which will make it more difficult to
maintain a common code base on Windows and UNIX.

Yes. SO why use Unix? It is not an approved MS OS what is more Unix does
not conform to the ISO Safe C or ISO Safe C++ Libraries.....

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ chris (AT) phaedsys (DOT) org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/



---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Back to top
Tom Einertson
Guest





PostPosted: Tue Jan 31, 2006 9:00 am    Post subject: Re: Visual Studio and ISO C++ Names Reply with quote

""P.J. Plauger"" <pjp (AT) dinkumware (DOT) com> wrote in message
news:37-dnTQ056haQ0DeRVn-pw (AT) giganews (DOT) com...
Quote:
devnull (AT) octopull (DOT) demon.co.uk> wrote in message
news:1138546549.729355.195400 (AT) o13g2000cwo (DOT) googlegroups.com...

"P.J. Plauger" wrote:

""Tom Einertson"" <tome@siemens-emis.com> wrote in message
news:YMqdnenWtqO8n0beRVn-iQ (AT) comcast (DOT) com...

I've read every C and
C++ book I own and searched the internet trying to find an explanation
for this change. For the life of me, I can't see how "_unlink" is any
more ISO C++ conformant than "unlink".

Both Standard C and Standard C++ let the implementation define
external symbols with a leading underscore, as conforming
extensions. But "unlink" invades the space of names reserved
to the programmer.

Um, doesn't this say that only an implementor of C++ should use the
name "_unlink" - and that a vendor neutral API would not be ISO
conformant were it to use this name?

Basically, yes. I'm the guy who insisted back in 1983 that the space of
names available to a C program be partitioned into:

a) those defined by the implementation for the benefit of the programmer
(such as printf)

b) those reserved to the programmer (such as foo)

c) those reserved to the implementation (such as _unlink)
...
In this particular case, Posix supplies a list of category (a) names
(such as unlink) that you should get defined when and only when you
include certain headers. Since the C Standard stole its headers from
Unix, which is the same source as for Posix, some of those headers
overlap historically. Nevertheless, compiler warnings should have
some way of taking into account whether the supported environment
is "pure" Standard C++ (a Platonic ideal) or a mixed C/C++/Posix
environment. The current attempt by Microsoft to help us poor
programmers fails to take that into account. It insists on treating
unlink as a category (b) name, which is myopic.

Actually it seems to me that previous versions of Visual Studio treated
unlink as a category (a) name, but now Microsoft wants to treat it as a
category (c) name (ie, _unlink), so they have introduced warnings to try
to get everyone to use _unlink instead. Of course there's not good
reason

Just slightly off the main topic of this thread, there's also the
situation with all the Visual Studio warning messages telling you that
all your favorite C/C++ functions are insecure and you should use the
new and improved Microsoft-provided secure interfaces instead. Just
because Microsoft apparently couldn't write secure code with the
existing functions doesn't mean that other people can't. Beyond that
issue, who made Microsoft the software police anyway? There's just a
certain arrogance about the whole thing.

I really wonder how this happened anyway. Did the Visual Studio team
really not think through the implications of what they were doing when
they introduced these warning messages? Or did they think it through
and decide to go ahead anyway? Or is this all the work of one rogue
programmer who wasn't adequately supervised? Or for you conspiracy
buffs out there, did they do it to try to push people away from
standard C++ interfaces and get them to use Microsoft proprietary
interfaces instead?

Don't any of the developers from Microsoft C++ hang out in this
newsgroup? I haven't seen any postings on this thread from anyone with
@microsoft.com in their e-mail address. If there is a more benign
explanation for this mess, I'd like to hear it.

--
Tom Einertson E-mail: tome@siemens-emis.com
SIEMENS Power Transmission & Distribution Phone: (952) 607-2244
Energy Management & Automation Division Fax: (952) 607-2018
10900 Wayzata Boulevard, Suite 400
Minnetonka, MN, 55305


---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Back to top
Dilip
Guest





PostPosted: Tue Jan 31, 2006 3:41 pm    Post subject: Re: Visual Studio and ISO C++ Names Reply with quote

"Tom Einertson" wrote:
Quote:
Don't any of the developers from Microsoft C++ hang out in this
newsgroup? I haven't seen any postings on this thread from anyone with
@microsoft.com in their e-mail address. If there is a more benign
explanation for this mess, I'd like to hear it.

Most of the Microsoft language lawyers and MVPs hang out at
microsoft.public.vc.language. I have taken the liberty of
cross-posting to that newsgroup also. Try re-starting this thread over
there.

---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language, library and standards All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.