I'm sure he realizes it isn't a function. Using parentheses around a return expression is a matter of convention. Some people do it, some people don't.
For that matter, I could also say:
(printf("Hello, world!\n"));
The parens may be superflous, but they certainly don't hurt anything, and in fact they can allow you to play some cool tricks, such as redefining return:
#define return(x) {printf("Returning from %s:%d\n", __FILE__, __LINE__);return x;}
Wow, I really wish I could live in a country where it's impossible to sleep at night, due to fear of a prosecuter dragging me back into court over an offense I'd already been acquitted of.
What a bastion of individual freedom you've got over there.
If you put a.0 kernel on your cluster at work, expect to lose your grants and your job.
That's not insightful, it's corporate bullshit.
If nobody is willing to test the new kernel on clusters, guess what? It'll never get the bugs worked out to run on clusters. Sure, that "all important" version number might click over to.2, and then.3... But so what? If you don't test it on clusters, it'll have bugs on clusters. (I hope this concept is not too complex for you.)
Yeah, I'm sure you'll wait until the mighty.1 release. And then you'll be the one under the gun, since nobody tested the.0 release, as per your (extremely deluded) advice.
I suppose you expect the kernel hackers to go out and buy a half-million dollar cluster to do the testing for us? How many arbitrary version numbers do you think we should wait before we jump in?
Do what I did. Get an EDTV television, capable of doing 480/720p vertical resolution. Many cable channels can already decode at this resolution (which is double the usual TV vertical resolution of somewhere between 240 and 260 lines). All DVDs can decode at this resolution.
No, it isn't 1080i, but you can tell the difference, and the EDTV televisions are much more affordable than their HDTV counterparts. I bought an EDTV plasma panel for about $3000 less than the nearest HDTV-capable model. Guess what? It looks AWESOME. The salesman at the store kept trying to convince me to pay $6000 for a similarly sized HDTV set. Right. Do I look stupid?
It's too bad that people are so hung up on HDTV. Either they stick with crappy CRT televisions, telling themselves "When the price comes down, I'll buy one," or they go out and spend THOUSANDS of dollars in order to receive what... 5 channels, max?
You're missing out on EDTV, which is cheaper, and it's available RIGHT NOW. And although yes, the resolution is less than HDTV, it still looks far better than standard television. By the time HDTV is finally standardized, your EDTV plasma display will be starting to burn out its natural lifetime, and it'll be time to upgrade to HDTV.
Why not give yourself good picture quality NOW instead of inflicting this crazy HDTV on yourself?
Of course people did a lot to stop him from taking over the freaking continent. I was referring to the fact that nobody did anything to stop him from murdering millions of innocents.
I mean, if they can't bother to do anything when the anti-spam sites get attacked, then they better damn well not do anything now.
Why is this rated interesting? That's a childish argument...
So what you're saying is, if law enforcement fails to perform their duties in one case, then as a result they should just quit, and not do anything at all?
Because Hitler killed millions in the '30s and '40s, and nobody did anything to stop him, we should therefore do nothing to prevent the massacres occurring in Nigeria and elsewhere at the present moment?
Do you see how what you've said is utterly ridiculous?
The giant difference is that GCC can target Wintel machines. Or 68000 machines. Or PowerPC. Or ARM. Or PA-RISC. Or R6K. Or a zillion other targets.
You do realize that you can use GCC to compile Windows applications, right? Let's see you use VC++ to compile something to run on Linux.
We're talking about giving up portability to different compilers here. Not different platforms. We're not even in the same ballpark as what Microsoft has done with their proprietary crap.
Remember that in C, an empty argument list is equivalent to an unspecified set of arguments. If you actually need to specify that a function takes no args, declare it as foo(void).
If you don't believe me, just try to compile the above. The compiler will produce no warning.
Hrm? Then the compiler warns you about using an uninitialized variable.
GCC doesn't. Are you using VC++?
By the way, the compiler will only warn about uninitialized variables if you have optimization turned on (it doesn't do the required data-flow analysis to detect uninitialized variables if the optimizer is turned off).
I'm assuming that the "x = x" gets optimized away during an earlier pass of GCC, thus the warning never gets generated. Other compilers might be different. It doesn't really make sense to warn about it anyway, because the statement "x = x" has no effect, regardless of whether x has a defined value or not.
If you put x=x; in the code, or even just x;, it is not likely that you will easily remember that x is "unused"
Hence the "/* shut up compiler warning */" comment.
In reality, whenever I do something tricky, kludgy, or non-portable, I put a comment which starts with/* XXX... */ I always know to search for "XXX" if I want to find all the oddities in the code. It's a fairly standard way to indicate that something weird is going on.
The major problem with your #ifdef suggestion, is that a lot of compilers implement the unused variable thing as a #pragma directive. Sadly, you cannot call #pragma from a macro. #pragma makes it extremely hard to write portable programs for this reason -- you can't write a macro that expands into a pragma directive. That sort of makes pragma useless for just about anything, IMHO.
My mother is a developer you insensitive clods!
Hey, no worries, so is mine:-) And my girlfriend too, for that matter...
Just because she works on projects most people don't even know exist (research-related academic stuff), it's still technically "open source" and thus there's at least ONE female open source developer that I know of.
What if in function x, there is a variable that I have defined but do not use for some specific reason
You can use GCC's attribute system:
int foo __attribute__ ((unused));
GCC supports all kinds of cool attributes, both for functions and variables. For example, the ((deprecated)) attribute marks a variable as deprecated, and will produce a warning if any code uses that variable.
However, these methods are not portable. On nearly any compiler I can imagine, the cleanest and simplest way to supress an unused variable warning is to assign the variable to itself:
int x;
x = x;/* shut up compiler warning */
Run 'info gcc' to get the full documentation. Go to the "C Extensions" section. GCC is littered with HUNDREDS of very cool extensions. Just make sure it's worth giving up portability...
Fines don't do jack to deter. It's far too easy to conceal assets from the government, and after all, these people are SPAMMERS who don't care about ethical issues. Surely their money is all off-shore somewhere it can't be touched.
Sure, you can sue some loser slimeball for $10 million, and even win, but just because the government says "You win" doesn't mean you'll get the money if that person doesn't have it.
On the other hand, the valuable years of our lives are an asset we all have. A spammer can't stash a few decades of lifetime in an offshore bank account. You take that away from them, and they can't get it back. That's a DETERRENT.
officials were in negotiations for the surrender of a second man...
They're negotiating a surrender? Sounds like something I'd see on prime time USA, with a SWAT team and about fifty riflemen with guns trained on a panoramic storefront window. The retard must be shitting in his pants about now...
Come out slowly, with your email headers unforged!
No, actually I use Linux, but since I've never changed the MAC on my card (what the hell reason would there be?) I just assumed it was done via flashing, like on Windows.
In any case that only strengthens my point -- somebody can drive around and change MAC addresses in real time. MAC locking is useless.
You're aware of Cygwin which provides all the GNU tools, compilers, linkers, editors, etc, even the standard UNIX APIs, all ported to Windows? I understand that you want to learn, but there are other UNIX emulation projects out there, and they took person-decades to write. You're just one guy...
"Earlier experiments on the storage of light stored only the 'signature' of the light pulses in a process somewhat similar to creating a hologram," said Bajcsy. "There were no signal photons present in the medium when the light was being stored. Our experiment, on the other hand, 'traps' actual signal photons inside the rubidium vapour in such a way that the overall signal pulse does not travel."
They are quite literally stopping the light.
Photons are quanta of energy; they are quite incapable of being split or combined. Consult your local library for books on quantam physics...
You'd go to the public library to learn about physics? No wonder your understanding is so botched and incomplete... I suppose you think what happened in this experiment is a figment of everyone's imagination? Quantum electrodynamics predicted that photons can split decades ago, and now they've done an experiment to prove it.
I think you've hit the nail on the head, as to why steganography is ultimately a useless method. Its goal is "security through obscurity."
Wait a second, I thought we all knew that security through obscurity was a terrible idea? And here's a method to send information secretly which basically is founded on the idea of obscurity. And we're supposed to think this is cool and useful?
The very idea of trying to send a message in secret is FLAWED. In my opinion, if the security of your scheme depends on people not knowing that you are sending messages, you're pretty well FUCKED to begin with. Come up with a new scheme.
This is exactly why I'm choosing the BSD license for my code. If you want my code, by all means USE it. By all means CHANGE it. In binary form if you wish. All I ask is that you don't claim that you WROTE IT yourself.
More and more these days, I view the GPL as moralistic masturbation. It's pathetic and sad. There are plenty of other things in this world that are worth being moralistic about. I don't see how software development falls under the same heading as "helping the homeless" or "stopping persecution" or any of those things we really ought to give a shit about.
Sorry, but I just don't want to waste my energy on that crap. My primary objective with my code is for people to USE it. Not to sit around smoking cigars with the boys arguing over who has a "right" to it. Grow up and find something worth fighting for, for chrissake.
For that matter, I could also say:
(printf("Hello, world!\n"));
The parens may be superflous, but they certainly don't hurt anything, and in fact they can allow you to play some cool tricks, such as redefining return:
#define return(x) {printf("Returning from %s:%d\n", __FILE__, __LINE__);return x;}
What a bastion of individual freedom you've got over there.
That's not insightful, it's corporate bullshit.
If nobody is willing to test the new kernel on clusters, guess what? It'll never get the bugs worked out to run on clusters. Sure, that "all important" version number might click over to .2, and then .3... But so what? If you don't test it on clusters, it'll have bugs on clusters. (I hope this concept is not too complex for you.)
Yeah, I'm sure you'll wait until the mighty .1 release. And then you'll be the one under the gun, since nobody tested the .0 release, as per your (extremely deluded) advice.
I suppose you expect the kernel hackers to go out and buy a half-million dollar cluster to do the testing for us? How many arbitrary version numbers do you think we should wait before we jump in?
Way to be massively ignorant.
Do what I did. Get an EDTV television, capable of doing 480/720p vertical resolution. Many cable channels can already decode at this resolution (which is double the usual TV vertical resolution of somewhere between 240 and 260 lines). All DVDs can decode at this resolution.
No, it isn't 1080i, but you can tell the difference, and the EDTV televisions are much more affordable than their HDTV counterparts. I bought an EDTV plasma panel for about $3000 less than the nearest HDTV-capable model. Guess what? It looks AWESOME. The salesman at the store kept trying to convince me to pay $6000 for a similarly sized HDTV set. Right. Do I look stupid?
It's too bad that people are so hung up on HDTV. Either they stick with crappy CRT televisions, telling themselves "When the price comes down, I'll buy one," or they go out and spend THOUSANDS of dollars in order to receive what... 5 channels, max?
You're missing out on EDTV, which is cheaper, and it's available RIGHT NOW. And although yes, the resolution is less than HDTV, it still looks far better than standard television. By the time HDTV is finally standardized, your EDTV plasma display will be starting to burn out its natural lifetime, and it'll be time to upgrade to HDTV.
Why not give yourself good picture quality NOW instead of inflicting this crazy HDTV on yourself?
What if x is a struct? You can't assign 0 to a struct, but you can always assign it to itself.
Of course people did a lot to stop him from taking over the freaking continent. I was referring to the fact that nobody did anything to stop him from murdering millions of innocents.
Why is this rated interesting? That's a childish argument...
So what you're saying is, if law enforcement fails to perform their duties in one case, then as a result they should just quit, and not do anything at all?
Because Hitler killed millions in the '30s and '40s, and nobody did anything to stop him, we should therefore do nothing to prevent the massacres occurring in Nigeria and elsewhere at the present moment?
Do you see how what you've said is utterly ridiculous?
What if the sky was blue?
Ahhh, shit, I knew I should have committed that faster.php I finished coding last night...
You do realize that you can use GCC to compile Windows applications, right? Let's see you use VC++ to compile something to run on Linux.
We're talking about giving up portability to different compilers here. Not different platforms. We're not even in the same ballpark as what Microsoft has done with their proprietary crap.
int foo()
{
return foo();
}
int main()
{
foo("xyz");
return 0;
}
Remember that in C, an empty argument list is equivalent to an unspecified set of arguments. If you actually need to specify that a function takes no args, declare it as foo(void).
If you don't believe me, just try to compile the above. The compiler will produce no warning.
GCC doesn't. Are you using VC++?
By the way, the compiler will only warn about uninitialized variables if you have optimization turned on (it doesn't do the required data-flow analysis to detect uninitialized variables if the optimizer is turned off).
I'm assuming that the "x = x" gets optimized away during an earlier pass of GCC, thus the warning never gets generated. Other compilers might be different. It doesn't really make sense to warn about it anyway, because the statement "x = x" has no effect, regardless of whether x has a defined value or not.
Hence the "/* shut up compiler warning */" comment.
In reality, whenever I do something tricky, kludgy, or non-portable, I put a comment which starts with /* XXX ... */ I always know to search for "XXX" if I want to find all the oddities in the code. It's a fairly standard way to indicate that something weird is going on.
The major problem with your #ifdef suggestion, is that a lot of compilers implement the unused variable thing as a #pragma directive. Sadly, you cannot call #pragma from a macro. #pragma makes it extremely hard to write portable programs for this reason -- you can't write a macro that expands into a pragma directive. That sort of makes pragma useless for just about anything, IMHO.
Just because she works on projects most people don't even know exist (research-related academic stuff), it's still technically "open source" and thus there's at least ONE female open source developer that I know of.
Congratulations... You've just proven that you live in your mother's basement.
You can use GCC's attribute system:
int foo __attribute__ ((unused));
GCC supports all kinds of cool attributes, both for functions and variables. For example, the ((deprecated)) attribute marks a variable as deprecated, and will produce a warning if any code uses that variable.
However, these methods are not portable. On nearly any compiler I can imagine, the cleanest and simplest way to supress an unused variable warning is to assign the variable to itself:
int x; /* shut up compiler warning */
x = x;
Run 'info gcc' to get the full documentation. Go to the "C Extensions" section. GCC is littered with HUNDREDS of very cool extensions. Just make sure it's worth giving up portability...
Sure, you can sue some loser slimeball for $10 million, and even win, but just because the government says "You win" doesn't mean you'll get the money if that person doesn't have it.
On the other hand, the valuable years of our lives are an asset we all have. A spammer can't stash a few decades of lifetime in an offshore bank account. You take that away from them, and they can't get it back. That's a DETERRENT.
officials were in negotiations for the surrender of a second man...
They're negotiating a surrender? Sounds like something I'd see on prime time USA, with a SWAT team and about fifty riflemen with guns trained on a panoramic storefront window. The retard must be shitting in his pants about now...
Come out slowly, with your email headers unforged!
In any case that only strengthens my point -- somebody can drive around and change MAC addresses in real time. MAC locking is useless.
You're aware of Cygwin which provides all the GNU tools, compilers, linkers, editors, etc, even the standard UNIX APIs, all ported to Windows? I understand that you want to learn, but there are other UNIX emulation projects out there, and they took person-decades to write. You're just one guy...
MAC locking is only secure against very casual intrusion. Most cards (all?) can be re-flashed with a new MAC.
"Earlier experiments on the storage of light stored only the 'signature' of the light pulses in a process somewhat similar to creating a hologram," said Bajcsy. "There were no signal photons present in the medium when the light was being stored. Our experiment, on the other hand, 'traps' actual signal photons inside the rubidium vapour in such a way that the overall signal pulse does not travel."
They are quite literally stopping the light.
Photons are quanta of energy; they are quite incapable of being split or combined. Consult your local library for books on quantam physics...
You'd go to the public library to learn about physics? No wonder your understanding is so botched and incomplete... I suppose you think what happened in this experiment is a figment of everyone's imagination? Quantum electrodynamics predicted that photons can split decades ago, and now they've done an experiment to prove it.
The links work, if you take the extraneous 'ggg' off the end ;-)
What a fucked up site...
Wait a second, I thought we all knew that security through obscurity was a terrible idea? And here's a method to send information secretly which basically is founded on the idea of obscurity. And we're supposed to think this is cool and useful?
The very idea of trying to send a message in secret is FLAWED. In my opinion, if the security of your scheme depends on people not knowing that you are sending messages, you're pretty well FUCKED to begin with. Come up with a new scheme.
More and more these days, I view the GPL as moralistic masturbation. It's pathetic and sad. There are plenty of other things in this world that are worth being moralistic about. I don't see how software development falls under the same heading as "helping the homeless" or "stopping persecution" or any of those things we really ought to give a shit about.
Sorry, but I just don't want to waste my energy on that crap. My primary objective with my code is for people to USE it. Not to sit around smoking cigars with the boys arguing over who has a "right" to it. Grow up and find something worth fighting for, for chrissake.