473,810 Members | 3,137 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WG14 Post Santa Clara mailing available

The Post Santa Clara mailing is now available from the WG14 web site at
http://www.open-std.org/jtc1/sc22/wg14

I also updated some of the other information on the pages.

Best regards
Keld Simonsen
Oct 12 '08
26 1767
Paul Hsieh <we******@gmail .comwrites:
On Oct 18, 6:30*am, James Kuyper <jameskuy...@ve rizon.netwrote:
[...]
>If they're going to include such a change in a future version of the C
standard, then the first step should be to deprecate the current usage
of "auto", which is precisely what the committee has decided to do.

I don't follow the logic. Will C++ specifically require the
deprecation of the old use of auto to support its new usage? Or is
this just introducing a difference for no reason?
The following is largely speculation on my part.

C++ is adding a new meaning for the "auto" keyword. At the same time,
C++ is dropping the old meaning. These two things are not
*necessarily* connected (C++ could have kept the old meaning), but (a)
use of "auto" with the old meaning is vanishingly rare in both C and
C++, and (b) having two meanings for the same keyword, though it's not
a problem for compilers, would make the language just a little bit
more confusing than it needs to be. (Compare "static".)

The reasons for making either change in C++ aren't quite as strong.
Dropping, or rather deprecating, the old meaning makes some sense, but
the reasons for doing so arguably aren't strong enough by themselves
to justify a language change. Avoiding gratuitous incompatibility
with C++ makes the justification just a little bit stronger. And if,
some day, C adopts C++'s new meaning for auto, having deprecated the
old one makes the resulting new C just a little bit less confusing.

As far as I know, any legal C program that uses the auto keyword would
be unaffected by simply deleting all occurrences. In other words, if
a C compiler had a predefined macro definition equivalent to

#define auto /* nothing */

then it wouldn't break anything. (This wasn't the case for pre-ANSI
C, where "auto x;" at block scope was a legal declaration; I'm not
sure whether it's true in C90.)

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Oct 18 '08 #21
Paul Hsieh wrote:
On Oct 18, 6:30 am, James Kuyper <jameskuy...@ve rizon.netwrote:
....
>It is commonplace in C++ code to not be sure what the type of an
expression is. The biggest reason for this is templates; but the
overloading of functions is also a contributing factor. This makes the
new C++ meaning attached to "auto" very convenient.

As I understand it, this isn't a lack of being sure, but rather that
its currently a syntactical nightmare that makes code unreadable.

template <typename T, typename Uvoid func (
const T&t,
const U&u,
){
what_type temp = t*u;
...

What should what_type be? Perhaps I'm not sufficiently familiar with
C++, but I'm unaware of any other syntax, nightmarical or otherwise,
that achieves the same effect as the new meaning that C++ has attached
to 'auto':

auto temp = t*u;
>The type of a numerical literal often depends upon the values of the
*_MAX macros from <limits.h>. Portable code cannot rely upon standard
typedefs such as size_t referring to any specific type, and it's a bad
idea to write code which makes assumptions about which type a
third-party typedef refers to. You can sometimes assume that the result
of an expression involving a typedef'd type will have the same type as
that typedef, but that's not always the case.

C++ will have to contend with this issue as well.
Yes, C++ has all the same opportunities that C has to be uncertain of
the type of an initializer expression. My point was that templates and
operator overloads make it orders of magnitude more likely to be a
problem in C++ than it is in C.
... If they have
decided its worth it, it seems like it would make perfect sense to
ride on their coat tails.
C is not C++, however great the overlap between the languages; the fact
that the new meaning for 'auto' is worth it's cost in C++ does not mean
that it's worth it in C.

.....
I don't think the rate of knowledge about the type of a declared
variable is all that different between C and C++. It may be more
confusing in C++, but the need to know exactly which one is basically
the same.
The need is the same; the feasibility of meeting that need is quite
different in the two languages.
....
>You talked about "leaving it alone for some future semantic extensions".

Yes, leaving open the possibility that the C++ idea can be adopted
later. Maybe waiting to see it proven in the C++ universe first or
just watching the Gnu C compiler adopt it as an extension for C as
well or whatever.
>If they're going to include such a change in a future version of the C
standard, then the first step should be to deprecate the current usage
of "auto", which is precisely what the committee has decided to do.

I don't follow the logic. Will C++ specifically require the
deprecation of the old use of auto to support its new usage?
It's not merely deprecated, the old usage of 'auto' is no longer
supported in n2723.pdf, the latest working draft I've picked up of the
next version of the C standard. I don't know whether there was an
intermediate version where the old usage was merely deprecated - I
stopped closely following the C++ standard's development a couple of
years ago. I think there should have been an intermediate version where
the old use was deprecated, and I would strongly favor the C committee
delivering at least one version where 'auto' is deprecated, before
delivering a version where it's current meaning disappears.

Oct 18 '08 #22
On Sat, 18 Oct 2008 23:14:52 +0000, James Kuyper wrote:
the old usage of 'auto' is no longer
supported in n2723.pdf, the latest working draft I've picked up of the
next version of the C standard.
You had me confused there. I'm sure you meant to say n2723 is a draft of
the next version of the C++ standard.
Oct 19 '08 #23
In article <M5************ ****@nwrddc01.g nilink.net>, James Kuyper
<ja*********@ve rizon.netwrote:
Paul Hsieh wrote:
On Oct 18, 6:30 am, James Kuyper <jameskuy...@ve rizon.netwrote:
...
It is commonplace in C++ code to not be sure what the type of an
expression is. The biggest reason for this is templates; but the
overloading of functions is also a contributing factor. This makes the
new C++ meaning attached to "auto" very convenient.
As I understand it, this isn't a lack of being sure, but rather that
its currently a syntactical nightmare that makes code unreadable.

template <typename T, typename Uvoid func (
const T&t,
const U&u,
){
what_type temp = t*u;
...

What should what_type be? Perhaps I'm not sufficiently familiar with
C++, but I'm unaware of any other syntax, nightmarical or otherwise,
that achieves the same effect as the new meaning that C++ has attached
to 'auto':

auto temp = t*u;
There is an ugly solution that's not very flexible, just mentioning it for
completeness:

template <typename T, typename U, typename what_typevoid func_ (
const T&t,
const U&u,
what_type temp
){
...
}

template <typename T, typename Uvoid func (
const T&t,
const U&u,
){
func_( t, u, t*u );
}
Oct 19 '08 #24
Harald van Dijk wrote:
On Sat, 18 Oct 2008 23:14:52 +0000, James Kuyper wrote:
>the old usage of 'auto' is no longer
supported in n2723.pdf, the latest working draft I've picked up of the
next version of the C standard.

You had me confused there. I'm sure you meant to say n2723 is a draft of
the next version of the C++ standard.
You are correct.

Oct 19 '08 #25
blargg wrote:
In article <M5************ ****@nwrddc01.g nilink.net>, James Kuyper
<ja*********@ve rizon.netwrote:
[Re: planned new meaning for 'auto' in C++ - connection to planned
deprecation of 'auto' in C.]
>template <typename T, typename Uvoid func (
const T&t,
const U&u,
){
what_type temp = t*u;
...

What should what_type be? Perhaps I'm not sufficiently familiar with
C++, but I'm unaware of any other syntax, nightmarical or otherwise,
that achieves the same effect as the new meaning that C++ has attached
to 'auto':

auto temp = t*u;

There is an ugly solution that's not very flexible, just mentioning it for
completeness:

template <typename T, typename U, typename what_typevoid func_ (
const T&t,
const U&u,
what_type temp
){
...
}

template <typename T, typename Uvoid func (
const T&t,
const U&u,
){
func_( t, u, t*u );
}
Yes - "not very flexible" indeed.
Oct 19 '08 #26
On Sat, 18 Oct 2008 10:21:32 -0700, Paul Hsieh <we******@gmail .comwrote:
On Oct 18, 6:30Â*am, James Kuyper <jameskuy...@ve rizon.netwrote:
(...)
>>
It is commonplace in C++ code to not be sure what the type of an
expression is. The biggest reason for this is templates; but the
overloading of functions is also a contributing factor. This makes the
new C++ meaning attached to "auto" very convenient.

As I understand it, this isn't a lack of being sure, but rather that its
currently a syntactical nightmare that makes code unreadable. (If you
are not sure today, and you type the wrong thing, your compiler will
tell you what you did wrong with an error message -- I sometimes
actually do this deliberately, when I am too lazy to look up the type.)
The purpose, I thought, was to respond to dynamic programming languages
which let you do away with specifying types.
>The benefits of such a change are much smaller in C. Not being certain
of the type of an expression is less common in C, though it can happen.

If we instead go with the "syntactica l nightmare" reason, we can see
that arrays of function pointers are types we would probably rather be
implicit.
>The type of a numerical literal often depends upon the values of the
*_MAX macros from <limits.h>. Portable code cannot rely upon standard
typedefs such as size_t referring to any specific type, and it's a bad
idea to write code which makes assumptions about which type a
third-party typedef refers to. You can sometimes assume that the result
of an expression involving a typedef'd type will have the same type as
that typedef, but that's not always the case.

C++ will have to contend with this issue as well. If they have decided
its worth it, it seems like it would make perfect sense to ride on their
coat tails.
>[...] However, in C you usually
have a pretty good idea what type an expression has. As a result, the
new C++ meaning for "auto" would be much less useful in C.

I don't think the rate of knowledge about the type of a declared
variable is all that different between C and C++. It may be more
confusing in C++, but the need to know exactly which one is basically
the same.
>The new C++ functionality of "auto" is moderately complicated;

Well, but this is due mostly to C++'s complications that don't exist in
C.
(...)

If anything, this thread in comp.lang.c++.m oderated, viz.,

MID: 47************* *@erdani.org

suggests introducing 'auto' could be murky in both C as well as C++.

- Anand

Oct 20 '08 #27

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

Similar topics

12
3829
by: Jan Roland Eriksson | last post by:
I have worked some more on this suggested new mFAQ version trying to get all user input to blend into the text. Another review by the NG would be welcome. ===== Archive-name: www/stylesheets/newsgroup-faq Posting-Frequency: once a week Last-modified: July 22, 2004
5
3151
by: Jan Roland Eriksson | last post by:
Some more fine tuning and inclusion of last suggested text from regulars has been done to this test post #4 of the mFAQ. As usual, rip it up anywhere you feel that it's appropriate to do so. ===== Archive-name: www/stylesheets/newsgroup-faq Posting-Frequency: once a week Last-modified: 2004-07-26
27
1812
by: VK | last post by:
Following the side thread about the time precision in browser at <http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/91b9f3fd90513161/1ea06131c63cfdf0?hl=en#doc_620f160f0cb57c8c> Statement: At the very least Internet Explorer doesn't go by "real" time in script methods. Instead it provides to script methods "application ticks" with predefined amount of milliseconds in them. If the requested time frame fits into an...
2
1977
by: Martin | last post by:
Hello, We are in the process of putting together an A class PHP Development team(ecommerce / billing applications) for a project in the Bay Area. Reqt. details: ReqId : Req-3616 - Senior PHP Developer Primary Skills: PHP, Linux, Apache Secondary Skills: C++, SQL
0
1865
by: Martin | last post by:
Hello, We are in the process of putting together an A class C++ Development team(ecommerce / billing applications) for a project in the Bay Area. Reqt. details: ReqId : Req-3911 - C++ Senior Developer Primary Skills: C++, SQL Secondary Skills: XML, Oracle Description: As a part of the development team for our client's
0
1647
by: Michael Hudson | last post by:
The PyPy team is sprinting at EuroPython again and we invite you to participate in our 3 day long sprint at the conference hotel - Reval Hotel Lietuva. If you plan to attend the sprint we recommend you to listen to the PyPy technical talks (`EuroPython schedule`_) during the conference since it will give you a good overview of the status of development. On the morning of the first sprint day (12th) we will also have a tutorial session...
0
947
by: =?iso-8859-1?q?Keld_J=F8rn?= Simonsen | last post by:
The 2008-06 post Sophia mailing, the core WG issues list revision 56 and the library WG issues list revision 57 are now available from the WG21 site at http://www.open-std.org/jtc1/sc22/wg21/ Best regards Keld Simonsen
14
1374
by: =?iso-8859-1?q?Keld_J=F8rn?= Simonsen | last post by:
The WG14 Pre Santa Barbara mailing is now available from the WG14 sita ay http://www.open-std.org/jtc1/sc22/wg14 There is also a new draft for the C standard N1336 and a new draft for the security enhanced functions N1337. est regards Keld Simonsen
0
1171
by: =?iso-8859-1?q?Keld_J=F8rn?= Simonsen | last post by:
The 2008-10 Post San Francisco mailing is now available from the WG21 web site at http://www.open-std.org/jtc1/sc22/wg21/ Also the core WG issues list rev 59 and the library WG issuse list rev 60 are now availabe. I also did a number of updates of other pages on the WG21 site. Best regards Keld Simonsen
0
9722
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10393
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4334
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3863
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.