Driver Problems? Questions? Issues?
Put OSR's experience to work for you! Contact us for assistance with:
  • Creating the right design for your requirements
  • Reviewing your existing driver code
  • Analyzing driver reliability/performance issues
  • Custom training mixed with consulting and focused directly on your specific areas of interest/concern.
Check us out. OSR, the Windows driver experts.

OSR Seminars


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 1  
09 Jul 18 21:32
Prokash Sinha
xxxxxx@gmail.com
Join Date: 28 Jun 2012
Posts To This List: 129
Re: [BULK] Re: Modern C++ Features in Kernel Mode Drivers

Back in the days, jumping around was the only means go get a loop or other construct like try_something(). So it was a natural , sequential improvement to have a goto, even non-local goto was given as setjmp(), longjmp()??? I used both goto, and not big of a do{ <???> }while(0);. Never used multilevel if (cold) more than two level ( this to me is a sign of getting tiered :) ). And in most cases, I have the 80 column bar on IDE, so I???m watchful there. And there are many, when I said I don???t like too much hidden things in kernel, I really meant it. Small things like using c++ constructs for lock holding and releasing not much of a concern, but if I see memory being allocated, and freed behind my back because of some constructs, I would worry. For those of us, who thinks OO is bad or ugly in the kernel , it is not really that bad. Apple I/O kit allows to do that ( public:, private, protected etc) are supported. Some 30+ odd years ago, MFC said forget multiple-inheritance and Apple I/O kit says the same thing - But still, IMO powerful construct. Do driver developer need all of these ? Yeah, most drivers are 3K to 5K loc, so I would say, IMO no, no ??? You look at the C++ book, from the horses mouth, he is encouraging situation when multiple inheritance is good. Even ++X, and X++ require attention??? So the list goes on and on. But when it comes to handling exception ( that surely help handling error condition in a much more elegant way ), I don???t see a clear affirmative YES. Here it is, try it ??? -Pro > On Jul 9, 2018, at 10:16 AM, xxxxx@gmail.com <xxxxx@lists.osr.com> wrote: > > The Linux kernel has some 100,000 goto references. The Goto wars have been around since the late 60's. > > I use them, but rarely. I don't go out of my way to code around them. They just happen when they need to happen. > > This is a fun read: http://wiki.c2.com/?GotoConsideredHarmful <http://wiki.c2.com/?GotoConsideredHarmful> > > > On Mon, Jul 9, 2018 at 5:15 AM xxxxx@gmail.com <mailto:xxxxx@gmail.com> <xxxxx@lists.osr.com <mailto:xxxxx@lists.osr.com>> wrote: <...excess quoted lines suppressed...> --
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntdev list to be able to post.

All times are GMT -5. The time now is 19:23.


Copyright ©2015, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license