Reputation
2,435
Top tag
Next privilege 2,500 Rep.
Create tag synonyms
Badges
1 15 32
Impact
~93k people reached

  • 0 posts edited
  • 0 helpful flags
  • 2,031 votes cast
Jun
24
comment How safe is it to compile a piece of source code from a random stranger?
@DocBrown LOL. You forgot to add "... and can get things done".
Jun
24
comment How safe is it to compile a piece of source code from a random stranger?
@jwenting Whatever happens to the compiler which makes it pwn my machine counts. Maybe it executes the compilation result, maybe it corrupts some data - whatever.
Jun
23
comment How safe is it to compile a piece of source code from a random stranger?
@logc We're an ISV, not a security auditing company, so being able to pwn anything is not the top requirement for us.
Jun
23
comment How safe is it to compile a piece of source code from a random stranger?
@Mandrill LOL, nope, I nitpick to just about anything and then I check the code with Cppcheck and also think of compiling it and looking at warnings if that's easy to do.
Jun
23
comment How safe is it to compile a piece of source code from a random stranger?
Any explanation of why compiling is totally safe? One can pwn a server by sending a cleverly crafted message - why can't he pwn a compiler by giving it a cleverly crafted input?
Jun
23
comment How safe is it to compile a piece of source code from a random stranger?
@RemcoGerlich I don't want to run it either but I want to compile it to see if the compiler emits any warnings.
Jun
23
comment How safe is it to compile a piece of source code from a random stranger?
@RemcoGerlich I'm not a security expert and clearly I would not pay much attention to some hardcoded array initializer contents.
Mar
31
comment Does path coverage guarantee finding all bugs?
It would be fair to change your code comments so that they say "path coverage" because that's what you're talking about.
Mar
4
comment How does branch prediction work, if you still have to check for the conditions?
This explanation is neat.
Nov
28
comment Starting Execution of Java Program
@justin: There're no member functions in C and there're no non-member functions in Java. There's no other choice in C - non-member functions are the only choice. There is some choice in Java (all functions are member functions but they can be either static or non-static). Non-static member functions could have been used as entry points - however the design choice was made in favor of static member functions and I don't know why it was done this way but I guess it is because it is simpler. Also please note that static for C functions and static for Java member functions are totally different.
Nov
28
comment Starting Execution of Java Program
@justin: C runtime invokes a non-member function main() and Java runtime invokes a static member function main() of some class that happens to contain it.
Nov
28
comment Starting Execution of Java Program
@justin: Yes, it uses main() non-member function the same way as C does.
Nov
28
comment Starting Execution of Java Program
@justin: Yes, mostly. You can call non-static member functions on specific objects and you can call static member functions using either a specific object or a class name.
Nov
28
comment Starting Execution of Java Program
@gnat: This is a 80th level newbie question - the OP cannot get out of the following dilemma: the book says it has to be static because there's no object yet and he cannot get why they would need an object given that C and C++ don't need an object.
Nov
28
comment Starting Execution of Java Program
@gnat: That question is about why it is a static function and not a non-static function (less newbie). This one is about why it is a member function in the first place.
Nov
28
comment Starting Execution of Java Program
@justin: I think calling them non-member functions would make things easier. stackoverflow.com/a/4863328/57428 I edited the answer.
Nov
28
comment Starting Execution of Java Program
@justin: All functions are standalone (also called free functions) in C - fread(), rand(), malloc(), main(). In C++ functions can be member functions and free functions.
Nov
28
comment Starting Execution of Java Program
That's an example of a very good newbie question.
Oct
29
comment How was the system clock first used in early computers?
@DanPichelman: That doesn't necessarily required a wall clock equivalent - a tick counter would be enough. Your task starts running - the counter value is saved in your session. Your task stops running - the stored value is subtracted from the current counter value and that's how long your task has been running.
Oct
29
comment How was the system clock first used in early computers?
@DanPichelman: How is Manhattan Project useful for commerce? Yet it certainly required computations provided by serious tools, not toys.