samshull / node-proxy

Deprecated: Harmony Proxies in node (no longer needed)
MIT License
162 stars 29 forks source link

warning: control reaches end of non-void function [-Wreturn-type] #31

Closed davidben closed 10 years ago

davidben commented 11 years ago

Noticed this in the output of a package I was installing.

  CXX(target) Release/obj.target/nodeproxy/src/node-proxy.o
../src/node-proxy.cc: In static member function ‘static v8::Handle<v8::Value> v8::NodeProxy::GetNamedProperty(v8::Local<v8::String>, const v8::AccessorInfo&)’:
../src/node-proxy.cc:816:1: warning: control reaches end of non-void function [-Wreturn-type]
  SOLINK_MODULE(target) Release/obj.target/nodeproxy.node
  SOLINK_MODULE(target) Release/obj.target/nodeproxy.node: Finished
  COPY Release/nodeproxy.node

Unless that codepath never triggers, you probably want a return Undefined(); or an exception at the end there, otherwise it might cause crashes.

samshull commented 11 years ago

Thanks, it appears to need a return Undefined() at the end of that method in order to ensure that at least something is always returned. I wonder why other compilers haven't caught it (or maybe I just wasn't paying attention). But thanks, I will fix it at some point in the future.

samshull commented 10 years ago

Fixed by #35