Guest User

Untitled

a guest
Aug 18th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. Is there a GCC extension for implict return values?
  2. class SomeClass {
  3. public:
  4. static int AdjustValue(float input);
  5. static int DoSomethingWithAdjustedValue(int adjustedInput);
  6. static int DoSomethingWithNormalValue(float input) {
  7. DoSomethingWithAdjustedValue(AdjustValue(input);}
  8. };
  9.  
  10. > g++ xa1.cpp -Wall
  11. xa1.cpp: In static member function ‘static int SomeClass::DoSomethingWithNormalValue(float)’:
  12. xa1.cpp:8: warning: no return statement in function returning non-void
  13. xa1.cpp:8: warning: control reaches end of non-void function
Add Comment
Please, Sign In to add comment