Think for a moment about the compiler checking const correctness adds.
Then, imagine a c++ with a syntax where we could create our own 'const'
like qualifier keywords.
In a multi threaded development environment one could imagine wanting to
declare a 'threadsafe' qualifier.
declare_qualifier threadsafe;
threadsafe would be a qualifier for methods - methods qualified as
threadsafe would cause compiler errors if they attempted to call non
threadsafe qualified methods.
Or, in the context of processing data from the user
declare_qualifier unsanitized;
Now, with some 'rules', we could create a keyword that would be used to
guard data directly entered by the user, and functions that work on that
data. Functions not expecting unsanitzed data would be disallowed from
reading or writing to unsanitized variables.
Conversion functions would use casting, and actual data parsing, to move
the data from a unsanitized into a 'sanitized' (or non-unsanitized)
buffer at which point it could be passed safely to SQL or other layers
in the app that are not so careful about what they process.
Im sure these are not the only two uses possible for custom qualifiers,
and the rules for each one, to work in their role successfully, would
have to have some way of being specified. But its time I think that
compiers tried harder to allow programmers to write 'correct' software
using tools more versatile than just 'const'.
|
|
0
|
|
|
|
Reply
|
chris.becke (32)
|
9/11/2009 3:04:09 PM |
|
On 11 Set, 17:04, Chris Becke <chris.be...@gmail.com> wrote:
> Think for a moment about the compiler checking const correctness adds.
>
> Then, imagine a c++ with a syntax where we could create our own 'const'
> like qualifier keywords.
>
> In a multi threaded development environment one could imagine wanting to
> declare a 'threadsafe' qualifier.
> declare_qualifier threadsafe;
>
> threadsafe would be a qualifier for methods - methods qualified as
> threadsafe would cause compiler errors if they attempted to call non
> threadsafe qualified methods.
http://www.ddj.com/cpp/184403766
>
> Or, in the context of processing data from the user
>
> =A0 =A0declare_qualifier unsanitized;
>
> Now, with some 'rules', we could create a keyword that would be used to
> guard data directly entered by the user, and functions that work on that
> data. Functions not expecting unsanitzed data would be disallowed from
> reading or writing to unsanitized variables.
> Conversion functions would use casting, and actual data parsing, to move
> the data from a unsanitized into a 'sanitized' (or non-unsanitized)
> buffer at which point it could be passed safely to SQL or other layers
> in the app that are not so careful about what they process.
>
> Im sure these are not the only two uses possible for custom qualifiers,
> and the rules for each one, to work in their role successfully, would
> have to have some way of being specified. But its time I think that
> compiers tried harder to allow programmers to write 'correct' software
> using tools more versatile than just 'const'.
|
|
0
|
|
|
|
Reply
|
xtrigger303 (47)
|
9/14/2009 11:13:02 AM
|
|
On 14 Set, 13:13, Francesco <xtrigger...@gmail.com> wrote:
[snip]
Hi Francesco, hi everybody,
just dropped in to tell that I'm extending my nickname to report my
full name - just to avoid confusion with the other Francesco who was
posting here before of my arrival.
Sorry for the OT post, have a good continuation in this thread.
Cheers,
Francesco S. Carta
|
|
0
|
|
|
|
Reply
|
entuland (631)
|
9/14/2009 1:16:31 PM
|
|
|
2 Replies
24 Views
(page loaded in 0.051 seconds)
Similiar Articles: Howto: Simulate a close (X) button in an applications toolbar ...In my multiply document application, I wish to have a right-most toolbar button act as the close ... I prefer not to make up my own > customized X button which. It's ... SetPixelFormat crash - comp.graphics.api.openglI wish I could. This is actually a production crash.. if only there was a way to ... Therefore I wrote my own ChoosePixelFormat function over the ::ChoosePixelFormat ... PDF Form submit with both HTML and FDF responses. - comp.text.pdf ...My PDF Submit button action refers to "ProcessForm.asp#FDF", which is my server ... For example, this is what I *wish* I could do with a pdf form: The user fills out a key ... Need help with map projection conversion in ENVI - comp.lang.idl ...My goal is to convert this image from its native ... routine (seems strange..), so I use the OUT_NAME keyword. ... > > Cheers, > > Robin Thanks, Robin -- I wish it was ... comp.lang.java.security - page 7... 8/24/2003 5:07:34 PM) Hi, I hope someone here can help me :) I wish to make a java ... own Policy-Implementation 0 79 (8/22/2003 9:00:32 AM) Hi, I want to implement my own ... looking for a RPG with low system requirements - comp.sys.ibm.pc ...I really envy you! You could go out and play Planescape: Torment for the very first time. if you just wanted. I wish i could do that again. Most Quickly Readable Font? - comp.fonts... used for hazard signs in industrial environments, but for road signs (and I wish I could ... from among those fonts based on the needed width of the lettering and your own ... Preventing A New Window From Grabbing Focus - comp.lang.java ...It'll> be used on Windows and other versions of Linux.>> HalI wish I could ... all the time) I came up with all kinds of crazy schemes to make it work. I made my own ... .g64 images - comp.sys.cbm.... which often have own hardware buffers/FIFOs and a way to halt transfer. Apart ... It would be nice to be able to ..." · "Gee I wish I could just say look at the FAQ but ... Fonts with numbers as subscripts - comp.fontsTherefore, if I wish to write H2O, I need a font which has "2" in smaller size ... until someone tells you the right keywords to ... are writing Word macros for your own ... Real Wishes Granted ~ Make A Real Wish Come True ~ Real Wish Comes ...2 After you submit your wish, you will immediately be directed to your very own and unique "Wish Page" - bookmark your ... What do I need to do to make my wish come true? 13 ... Make my wish come true Poem | Poetry of Lifegreatt work….loved it can i also drop in some poems of my own?? ... how could u man ! its really awesome. i wish i could talk 2 u ,i know u will better ... 7/27/2012 4:25:57 PM
|