Skip to main content
Expand & link UB abbreviation
Source Link
doubleYou
  • 2.9k
  • 1
  • 14
  • 26

But what if some hack comes along and throws an uninitialized int into my beautiful function?

Then Unexpected Behavioryou get Undefined Behavior, and your default will be meaningless. There's nothing that you can possibly do to make this any better.

Edit: Let me be more clear. The instant someone passes an uninitialized intint into your function, it is UnexpectedUndefined Behavior. Your function could solve the Halting Problem and it wouldn't matter. It is UB. There is nothing you can possibly do once UB has been invoked.

But what if some hack comes along and throws an uninitialized int into my beautiful function?

Then Unexpected Behavior, and your default will be meaningless. There's nothing that you can possibly do to make this any better.

Edit: Let me be more clear. The instant someone passes an uninitialized int into your function, it is Unexpected Behavior. Your function could solve the Halting Problem and it wouldn't matter. It is UB. There is nothing you can possibly do once UB has been invoked.

But what if some hack comes along and throws an uninitialized int into my beautiful function?

Then you get Undefined Behavior, and your default will be meaningless. There's nothing that you can possibly do to make this any better.

Let me be more clear. The instant someone passes an uninitialized int into your function, it is Undefined Behavior. Your function could solve the Halting Problem and it wouldn't matter. It is UB. There is nothing you can possibly do once UB has been invoked.

But what if some hack comes along and throws an uninitialized int into my beautiful function?

Then UBUnexpected Behavior, and your default will be meaningless. There's nothing that you can possibly do to make this any better.

Edit: Let me be more clear. The instant someone passes an uninitialized int into your function, it is UBUnexpected Behavior. Your function could solve the Halting Problem and it wouldn't matter. It is UB. There is nothing you can possibly do once UB has been invoked.

But what if some hack comes along and throws an uninitialized int into my beautiful function?

Then UB, and your default will be meaningless. There's nothing that you can possibly do to make this any better.

Edit: Let me be more clear. The instant someone passes an uninitialized int into your function, it is UB. Your function could solve the Halting Problem and it wouldn't matter. It is UB. There is nothing you can possibly do once UB has been invoked.

But what if some hack comes along and throws an uninitialized int into my beautiful function?

Then Unexpected Behavior, and your default will be meaningless. There's nothing that you can possibly do to make this any better.

Edit: Let me be more clear. The instant someone passes an uninitialized int into your function, it is Unexpected Behavior. Your function could solve the Halting Problem and it wouldn't matter. It is UB. There is nothing you can possibly do once UB has been invoked.

added 252 characters in body
Source Link
DeadMG
  • 36.9k
  • 8
  • 74
  • 141

But what if some hack comes along and throws an uninitialized int into my beautiful function?

Then UB, and your default will be meaningless. There's nothing that you can possibly do to make this any better.

Edit: Let me be more clear. The instant someone passes an uninitialized int into your function, it is UB. Your function could solve the Halting Problem and it wouldn't matter. It is UB. There is nothing you can possibly do once UB has been invoked.

But what if some hack comes along and throws an uninitialized int into my beautiful function?

Then UB, and your default will be meaningless. There's nothing that you can possibly do to make this any better.

But what if some hack comes along and throws an uninitialized int into my beautiful function?

Then UB, and your default will be meaningless. There's nothing that you can possibly do to make this any better.

Edit: Let me be more clear. The instant someone passes an uninitialized int into your function, it is UB. Your function could solve the Halting Problem and it wouldn't matter. It is UB. There is nothing you can possibly do once UB has been invoked.

Source Link
DeadMG
  • 36.9k
  • 8
  • 74
  • 141
Loading