Re: Do we care if C compilers start allowing "." on pointers?
"Paul E. McKenney" <[email protected]>
| Newsgroups | org.kernel.vger.linux-toolchains |
|---|---|
| Message-ID | <ea052c7c-8186-43b8-8b49-8e5f28f99acf@paulmck-laptop> |
On Fri, Jan 10, 2025 at 05:09:21PM -0800, Bill Wendling wrote: > On Fri, Jan 10, 2025 at 7:02 AM Paul E. McKenney <[email protected]> wrote: > > > > Hello! > > > > Currently, given a pointer "p", C allows p->a but not p.a. There is a > > proposal from C++ [1] that is being considered for C. > > > > Do we care? > > > Does the proposal seem likely to be added to C++? The motivation is > very weak, in my opinion. Other languages are very different from > C/C++; they try to hide away memory management details, which are a > major part of C languages. (To prevent a holy war, my comments aren't > about the benefits and drawbacks of memory management in other > languages.) > > As for the kernel, if C/C++ adopt this convention, we won't be able to > accept contributions which use '.' to access pointers until the > minimum version of the compilers support this feature, which I imagine > will take several years. My personal opinion would be to require '->' > even when the option is available, unless a much better motivation is > made. Can't say that I disagree with any of this. ;-) Other thoughts? Thanx, Paul