Re: proposed change to style(9): require yoda style if statements

2010-05-12 Thread Dominic Fandrey
On 11/05/2010 21:36, Eitan Adler wrote: My proposal is simple: require that any if statement that compares a constant to a mutable variable be written as if (constant == variable) instead of if (variable == constant) this prevents an extremely common programming error if (variable =

adding check option to md5(1) [was: md5(1) and cal(1) on -questions]

2010-05-12 Thread Eitan Adler
D 2. Why doesn't md5(1) have a check option?  Seems to me requiring a D manual inspection is error-prone at best, and makes scripting D unecessarily complicated. Would something like the attached patch be good? It adds a -c option for a string to check against. It prints [failed] if the string

Re: proposed change to style(9): require yoda style if statements

2010-05-12 Thread Dag-Erling Smørgrav
Dominic Fandrey kamik...@bsdforen.de writes: I think the pro-yoda faction actually has more convincing arguments, Which ones? Never seen any beyond the basic helps avoid accidentally typing = instead of ==. It's bollocks, anyway, because a) for every (variable == constant) comparison you have

Re: proposed change to style(9): require yoda style if statements

2010-05-12 Thread Dominic Fandrey
On 12/05/2010 14:43, Dag-Erling Smørgrav wrote: Dominic Fandrey kamik...@bsdforen.de writes: I think the pro-yoda faction actually has more convincing arguments, Which ones? Never seen any beyond the basic helps avoid accidentally typing = instead of ==. It's bollocks, anyway, because a)

Re: proposed change to style(9): require yoda style if statements

2010-05-12 Thread Dag-Erling Smørgrav
Dominic Fandrey kamik...@bsdforen.de writes: Dag-Erling Smørgrav d...@des.no writes: Your .sig is strangely appropriate... Not my invention, this is a pretty common one, used by many people on the net. I actually have no idea where it comes from. My point is that it is strangely appropriate

utimes(2): changing the birth time

2010-05-12 Thread Knowledge Seeker
Hi, Is there a way to set birth time to a value greater(newer) than the actual birth time (not in the future, but not the current time)? The man page utimes(2) says that is only possible to change to an older value. I saw a way to do this by opening a new file, coping the data, setting the other

Re: utimes(2): changing the birth time

2010-05-12 Thread Gary Jennejohn
On Wed, 12 May 2010 17:53:38 + Knowledge Seeker knosee...@googlemail.com wrote: Hi, Is there a way to set birth time to a value greater(newer) than the actual birth time (not in the future, but not the current time)? The man page utimes(2) says that is only possible to change to an older

Re: utimes(2): changing the birth time

2010-05-12 Thread pluknet
On 12 May 2010 22:38, Gary Jennejohn gljennj...@googlemail.com wrote: On Wed, 12 May 2010 17:53:38 + Knowledge Seeker knosee...@googlemail.com wrote: Hi, Is there a way to set birth time to a value greater(newer) than the actual birth time (not in the future, but not the current time)?

argv offset -- doesn't make sense...

2010-05-12 Thread Garrett Cooper
Hi Hackers, Ignoring the compiler warning (yes, I know...), why is the offset for the argv[0] (program name) in the following program off by one? It doesn't make sense why the fstat would work, but the printf would fail (and in fact segfault if I remove the 1 argc guard statement and

Re: argv offset -- doesn't make sense...

2010-05-12 Thread Garrett Cooper
On May 12, 2010, at 6:54 PM, Mike Meyer wrote: On Wed, 12 May 2010 17:30:48 -0400 Garrett Cooper yanef...@gmail.com wrote: Hi Hackers, Ignoring the compiler warning (yes, I know...), why is the offset for the argv[0] (program name) in the following program off by one? It doesn't