node-pty icon indicating copy to clipboard operation
node-pty copied to clipboard

Fix compiler warnings

Open Tyriar opened this issue 9 years ago • 2 comments

..\src\win\pty.cc(70): warning C4311: 'type cast': pointer truncation from 'HANDLE' to 'int' [C:\Users\Daniel\Documents\dev\Tyriar\pty.js\build\pty.vcxproj]
..\src\win\pty.cc(70): warning C4302: 'type cast': truncation from 'HANDLE' to 'int' [C:\Users\Daniel\Documents\dev\Tyriar\pty.js\build\pty.vcxproj]
..\src\win\pty.cc(81): warning C4311: 'type cast': pointer truncation from 'HANDLE' to 'int' [C:\Users\Daniel\Documents\dev\Tyriar\pty.js\build\pty.vcxproj]
..\src\win\pty.cc(81): warning C4302: 'type cast': truncation from 'HANDLE' to 'int' [C:\Users\Daniel\Documents\dev\Tyriar\pty.js\build\pty.vcxproj]
..\src\win\pty.cc(354): warning C4311: 'type cast': pointer truncation from 'HANDLE' to 'int' [C:\Users\Daniel\Documents\dev\Tyriar\pty.js\build\pty.vcxproj]
..\src\win\pty.cc(354): warning C4302: 'type cast': truncation from 'HANDLE' to 'int' [C:\Users\Daniel\Documents\dev\Tyriar\pty.js\build\pty.vcxproj]

From https://github.com/microsoft/node-pty/issues/201

$ npm install

> [email protected] install /Users/technosophos/Code/ttystudio/node_modules/node-pty
> node scripts/install.js

  CXX(target) Release/obj.target/pty/src/unix/pty.o
../src/unix/pty.cc:154:25: warning: 'Utf8Value' is deprecated [-Wdeprecated-declarations]
  v8::String::Utf8Value file(info[0]->ToString());
                        ^
/Users/technosophos/.node-gyp/10.3.0/include/node/v8.h:2821:5: note: 'Utf8Value' has been explicitly
      marked deprecated here
    V8_DEPRECATED("Use Isolate version",
    ^
/Users/technosophos/.node-gyp/10.3.0/include/node/v8config.h:321:29: note: expanded from macro
      'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../src/unix/pty.cc:165:27: warning: 'Utf8Value' is deprecated [-Wdeprecated-declarations]
    v8::String::Utf8Value arg(argv_->Get(Nan::New<v8::Integer>(i))->ToString());
                          ^
/Users/technosophos/.node-gyp/10.3.0/include/node/v8.h:2821:5: note: 'Utf8Value' has been explicitly
      marked deprecated here
    V8_DEPRECATED("Use Isolate version",
    ^
/Users/technosophos/.node-gyp/10.3.0/include/node/v8config.h:321:29: note: expanded from macro
      'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../src/unix/pty.cc:176:27: warning: 'Utf8Value' is deprecated [-Wdeprecated-declarations]
    v8::String::Utf8Value pair(env_->Get(Nan::New<v8::Integer>(i))->ToString());
                          ^
/Users/technosophos/.node-gyp/10.3.0/include/node/v8.h:2821:5: note: 'Utf8Value' has been explicitly
      marked deprecated here
    V8_DEPRECATED("Use Isolate version",
    ^
/Users/technosophos/.node-gyp/10.3.0/include/node/v8config.h:321:29: note: expanded from macro
      'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../src/unix/pty.cc:181:25: warning: 'Utf8Value' is deprecated [-Wdeprecated-declarations]
  v8::String::Utf8Value cwd_(info[3]->ToString());
                        ^
/Users/technosophos/.node-gyp/10.3.0/include/node/v8.h:2821:5: note: 'Utf8Value' has been explicitly
      marked deprecated here
    V8_DEPRECATED("Use Isolate version",
    ^
/Users/technosophos/.node-gyp/10.3.0/include/node/v8config.h:321:29: note: expanded from macro
      'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../src/unix/pty.cc:389:25: warning: 'Utf8Value' is deprecated [-Wdeprecated-declarations]
  v8::String::Utf8Value tty_(info[1]->ToString());
                        ^
/Users/technosophos/.node-gyp/10.3.0/include/node/v8.h:2821:5: note: 'Utf8Value' has been explicitly
      marked deprecated here
    V8_DEPRECATED("Use Isolate version",
    ^
/Users/technosophos/.node-gyp/10.3.0/include/node/v8config.h:321:29: note: expanded from macro
      'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../src/unix/pty.cc:489:21: warning: 'Call' is deprecated [-Wdeprecated-declarations]
  Nan::Callback(cb).Call(Nan::GetCurrentContext()->Global(), 2, argv);
                    ^
../../nan/nan.h:1595:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
../../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
6 warnings generated.
  SOLINK_MODULE(target) Release/pty.node

> [email protected] postinstall /Users/technosophos/Code/ttystudio/node_modules/node-pty
> node scripts/post-install.js

added 2 packages from 9 contributors and audited 4 packages in 3.166s
found 0 vulnerabilities
$  node -v 
v10.3.0

Tyriar avatar Jan 06 '17 22:01 Tyriar

So, uh, any progress on this yet? While I guess these instances aren't going to hurt anything, it still looks super scary ...

SamB avatar Jul 11 '19 18:07 SamB

@SamB was hoping someone more familiar with to Windows API programming would take this up.

Tyriar avatar Jul 11 '19 18:07 Tyriar

Some of this is fixed, closing out to reduce issue count

Tyriar avatar Dec 27 '22 11:12 Tyriar