Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes msvc warnings #4976

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lygstate
Copy link
Contributor

@lygstate lygstate commented Feb 9, 2022

Try fixes the following warnings:

Checking Build System
  Building Custom Rule C:/projects/jerryscript/CMakeLists.txt
  Building Custom Rule C:/projects/jerryscript/jerry-core/CMakeLists.txt
  jerry-debugger-transport.c
  jerry-debugger.c
  jerry-module.c
  jerry-snapshot.c
  jerryscript.c
C:\projects\jerryscript\jerry-core\api\jerryscript.c(3239): warning C4028: formal parameter 1 different from declaration [C:\projects\jerryscript\build\jerry-core\jerry-core.vcxproj]
  debugger.c
  ecma-alloc.c
  ecma-gc.c
  ecma-errors.c
  ecma-extended-info.c
  ecma-helpers-collection.c
  ecma-helpers-conversion.c
C:\projects\jerryscript\jerry-core\ecma\base\ecma-helpers-conversion.c(295): warning C4028: formal parameter 2 different from declaration [C:\projects\jerryscript\build\jerry-core\jerry-core.vcxproj]
C:\projects\jerryscript\jerry-core\ecma\base\ecma-helpers-conversion.c(724): warning C4146: unary minus operator applied to unsigned type, result still unsigned [C:\projects\jerryscript\build\jerry-core\jerry-core.vcxproj]
  ecma-helpers-errol.c
  ecma-helpers-external-pointers.c
  ecma-helpers-number.c
  ecma-helpers-string.c
  ecma-helpers-value.c
  ecma-helpers.c
  ecma-init-finalize.c
  ecma-lcache.c
  Generating Code...
  Compiling...
  ecma-line-info.c
  ecma-literal-storage.c
  ecma-module.c
  ecma-property-hashmap.c
  ecma-builtin-aggregateerror.c
  ecma-builtin-aggregateerror-prototype.c
  ecma-builtin-array-iterator-prototype.c
  ecma-builtin-array-prototype-unscopables.c
  ecma-builtin-array-prototype.c
  ecma-builtin-array.c
  ecma-builtin-arraybuffer-prototype.c
  ecma-builtin-arraybuffer.c
  ecma-builtin-async-from-sync-iterator-prototype.c
  ecma-builtin-async-function-prototype.c
  ecma-builtin-async-function.c
  ecma-builtin-async-generator-function.c
  ecma-builtin-async-generator-prototype.c
  ecma-builtin-async-generator.c
  ecma-builtin-async-iterator-prototype.c
  ecma-builtin-atomics.c
  Generating Code...
  Compiling...
  ecma-builtin-bigint-prototype.c
  ecma-builtin-bigint.c
  ecma-builtin-boolean-prototype.c
  ecma-builtin-boolean.c
  ecma-builtin-dataview-prototype.c
  ecma-builtin-dataview.c
  ecma-builtin-date-prototype.c
  ecma-builtin-date.c
  ecma-builtin-error-prototype.c
  ecma-builtin-error.c
  ecma-builtin-evalerror-prototype.c
  ecma-builtin-evalerror.c
  ecma-builtin-function-prototype.c
  ecma-builtin-function.c
  ecma-builtin-generator-function.c
  ecma-builtin-generator-prototype.c
  ecma-builtin-generator.c
  ecma-builtin-global.c
  ecma-builtin-handlers.c
  ecma-builtin-helpers-date.c
  Generating Code...
  Compiling...
  ecma-builtin-helpers-error.c
  ecma-builtin-helpers-json.c
  ecma-builtin-helpers-sort.c
  ecma-builtin-helpers.c
  ecma-builtin-intrinsic.c
  ecma-builtin-iterator-prototype.c
  ecma-builtin-json.c
  ecma-builtin-map-iterator-prototype.c
  ecma-builtin-map-prototype.c
  ecma-builtin-map.c
  ecma-builtin-math.c
  ecma-builtin-number-prototype.c
  ecma-builtin-number.c
  ecma-builtin-object-prototype.c
  ecma-builtin-object.c
  ecma-builtin-promise-prototype.c
  ecma-builtin-promise.c
  ecma-builtin-proxy.c
  ecma-builtin-rangeerror-prototype.c
  ecma-builtin-rangeerror.c
  Generating Code...
  Compiling...
  ecma-builtin-referenceerror-prototype.c
  ecma-builtin-referenceerror.c
  ecma-builtin-reflect.c
  ecma-builtin-regexp-prototype.c
  ecma-builtin-regexp-string-iterator-prototype.c
  ecma-builtin-regexp.c
  ecma-builtin-set-iterator-prototype.c
  ecma-builtin-set-prototype.c
  ecma-builtin-set.c
  ecma-builtin-shared-arraybuffer-prototype.c
  ecma-builtin-shared-arraybuffer.c
  ecma-builtin-string-iterator-prototype.c
  ecma-builtin-string-prototype.c
  ecma-builtin-string.c
  ecma-builtin-symbol-prototype.c
  ecma-builtin-symbol.c
  ecma-builtin-syntaxerror-prototype.c
  ecma-builtin-syntaxerror.c
  ecma-builtin-type-error-thrower.c
  ecma-builtin-typeerror-prototype.c
  Generating Code...
  Compiling...
  ecma-builtin-typeerror.c
  ecma-builtin-urierror-prototype.c
  ecma-builtin-urierror.c
  ecma-builtin-weakmap-prototype.c
  ecma-builtin-weakmap.c
  ecma-builtin-weakref-prototype.c
  ecma-builtin-weakref.c
  ecma-builtin-weakset-prototype.c
  ecma-builtin-weakset.c
  ecma-builtins.c
  ecma-builtin-bigint64array-prototype.c
  ecma-builtin-bigint64array.c
  ecma-builtin-biguint64array-prototype.c
  ecma-builtin-biguint64array.c
  ecma-builtin-float32array-prototype.c
  ecma-builtin-float32array.c
  ecma-builtin-float64array-prototype.c
  ecma-builtin-float64array.c
  ecma-builtin-int16array-prototype.c
  ecma-builtin-int16array.c
  Generating Code...
  Compiling...
  ecma-builtin-int32array-prototype.c
  ecma-builtin-int32array.c
  ecma-builtin-int8array-prototype.c
  ecma-builtin-int8array.c
  ecma-builtin-typedarray-helpers.c
  ecma-builtin-typedarray-prototype.c
  ecma-builtin-typedarray.c
  ecma-builtin-uint16array-prototype.c
  ecma-builtin-uint16array.c
  ecma-builtin-uint32array-prototype.c
  ecma-builtin-uint32array.c
  ecma-builtin-uint8array-prototype.c
  ecma-builtin-uint8array.c
  ecma-builtin-uint8clampedarray-prototype.c
  ecma-builtin-uint8clampedarray.c
  ecma-arguments-object.c
  ecma-array-object.c
  ecma-arraybuffer-object.c
  ecma-async-generator-object.c
  ecma-atomics-object.c
  Generating Code...
  Compiling...
  ecma-big-uint.c
  ecma-bigint-object.c
  ecma-bigint.c
  ecma-boolean-object.c
  ecma-comparison.c
  ecma-container-object.c
  ecma-conversion.c
  ecma-dataview-object.c
  ecma-eval.c
  ecma-exceptions.c
  ecma-function-object.c
  ecma-get-put-value.c
  ecma-iterator-object.c
  ecma-jobqueue.c
  ecma-lex-env.c
  ecma-number-object.c
  ecma-objects-general.c
  ecma-objects.c
  ecma-promise-object.c
  ecma-proxy-object.c
  Generating Code...
  Compiling...
  ecma-reference.c
  ecma-regexp-object.c
  ecma-shared-arraybuffer-object.c
  ecma-string-object.c
  ecma-symbol-object.c
  ecma-typedarray-object.c
  jcontext.c
  jmem-allocator.c
  jmem-heap.c
  jmem-poolman.c
  jrt-fatals.c
  jrt-logging.c
  lit-char-helpers.c
C:\projects\jerryscript\jerry-core\lit\lit-char-helpers.c(141): warning C4018: '<=': signed/unsigned mismatch [C:\projects\jerryscript\build\jerry-core\jerry-core.vcxproj]
C:\projects\jerryscript\jerry-core\lit\lit-char-helpers.c(517): warning C4028: formal parameter 2 different from declaration [C:\projects\jerryscript\build\jerry-core\jerry-core.vcxproj]
  lit-magic-strings.c
  lit-strings.c
  byte-code.c
  common.c
  js-lexer.c
  js-parser-expr.c
  js-parser-line-info-create.c
  Generating Code...
  Compiling...
  js-parser-mem.c
  js-parser-module.c
  js-parser-statm.c
  js-parser-tagged-template-literal.c
  js-parser-util.c
  js-parser.c
  js-scanner-ops.c
  js-scanner-util.c
C:\projects\jerryscript\jerry-core\parser\js\js-scanner-util.c(2257): warning C4090: 'function': different 'const' qualifiers [C:\projects\jerryscript\build\jerry-core\jerry-core.vcxproj]
C:\projects\jerryscript\jerry-core\parser\js\js-scanner-util.c(2486): warning C4090: 'function': different 'const' qualifiers [C:\projects\jerryscript\build\jerry-core\jerry-core.vcxproj]
  js-scanner.c
  parser-errors.c
  re-bytecode.c
  re-compiler.c
  re-parser.c
  opcodes-ecma-arithmetics.c
  opcodes-ecma-bitwise.c
  opcodes-ecma-relational-equality.c
  opcodes.c
  vm-stack.c
  vm-utils.c
  vm.c
  Generating Code...
  jerry-core.vcxproj -> C:\projects\jerryscript\build\lib\Debug\jerry-core.lib
  Building Custom Rule C:/projects/jerryscript/jerry-ext/CMakeLists.txt
  arg-js-iterator-helper.c
  arg-transform-functions.c
  arg.c
  debugger-common.c
  debugger-rp.c
  debugger-serial.c
  debugger-sha1.c
  debugger-tcp.c
  debugger-ws.c
  handle-scope-allocator.c
  handle-scope.c
  module.c
  handlers.c
  print.c
  properties.c
  repl.c
  sources.c
  test262.c
  Generating Code...
  jerry-ext.vcxproj -> C:\projects\jerryscript\build\lib\Debug\jerry-ext.lib
  Building Custom Rule C:/projects/jerryscript/jerry-port/CMakeLists.txt
  jerry-port-context.c
  jerry-port-fs.c
  jerry-port-io.c
  jerry-port-process.c
  jerry-port-unix-date.c
  jerry-port-unix-fs.c
  jerry-port-unix-process.c
  jerry-port-win-date.c
  jerry-port-win-fs.c
  jerry-port-win-process.c
  Generating Code...

The following warnings can not be fixed properly by direct cast, as byte code can resident in ready-only ROM,
looking for suggestion.

[build] [207/235  82% :: 5.305] Building C object jerry-core\CMakeFiles\jerry-core.dir\parser\js\js-scanner-util.c.obj
[build] E:\CI-Cor\acrop\acrop-deps\acrop-jerry\jerryscript\jerry-core\parser\js\js-scanner-util.c(2257): warning C4090: 'function': different 'const' qualifiers
[build] E:\CI-Cor\acrop\acrop-deps\acrop-jerry\jerryscript\jerry-core\parser\js\js-scanner-util.c(2486): warning C4090: 'function': different 'const' qualifiers

The code is

        memcpy (&literal.char_p, data_p + 2 + 1, sizeof (uintptr_t));

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo [email protected]

@lygstate lygstate force-pushed the fix-warnings branch 5 times, most recently from 7d21071 to 0244f0c Compare February 9, 2022 22:38
Try fixes the following warnings:
```
Checking Build System
  Building Custom Rule C:/projects/jerryscript/CMakeLists.txt
  Building Custom Rule C:/projects/jerryscript/jerry-core/CMakeLists.txt
  jerry-debugger-transport.c
  jerry-debugger.c
  jerry-module.c
  jerry-snapshot.c
  jerryscript.c
C:\projects\jerryscript\jerry-core\api\jerryscript.c(3239): warning C4028: formal parameter 1 different from declaration [C:\projects\jerryscript\build\jerry-core\jerry-core.vcxproj]
  debugger.c
  ecma-alloc.c
  ecma-gc.c
  ecma-errors.c
  ecma-extended-info.c
  ecma-helpers-collection.c
  ecma-helpers-conversion.c
C:\projects\jerryscript\jerry-core\ecma\base\ecma-helpers-conversion.c(295): warning C4028: formal parameter 2 different from declaration [C:\projects\jerryscript\build\jerry-core\jerry-core.vcxproj]
C:\projects\jerryscript\jerry-core\ecma\base\ecma-helpers-conversion.c(724): warning C4146: unary minus operator applied to unsigned type, result still unsigned [C:\projects\jerryscript\build\jerry-core\jerry-core.vcxproj]
  ecma-helpers-errol.c
  ecma-helpers-external-pointers.c
  ecma-helpers-number.c
  ecma-helpers-string.c
  ecma-helpers-value.c
  ecma-helpers.c
  ecma-init-finalize.c
  ecma-lcache.c
  Generating Code...
  Compiling...
  ecma-line-info.c
  ecma-literal-storage.c
  ecma-module.c
  ecma-property-hashmap.c
  ecma-builtin-aggregateerror.c
  ecma-builtin-aggregateerror-prototype.c
  ecma-builtin-array-iterator-prototype.c
  ecma-builtin-array-prototype-unscopables.c
  ecma-builtin-array-prototype.c
  ecma-builtin-array.c
  ecma-builtin-arraybuffer-prototype.c
  ecma-builtin-arraybuffer.c
  ecma-builtin-async-from-sync-iterator-prototype.c
  ecma-builtin-async-function-prototype.c
  ecma-builtin-async-function.c
  ecma-builtin-async-generator-function.c
  ecma-builtin-async-generator-prototype.c
  ecma-builtin-async-generator.c
  ecma-builtin-async-iterator-prototype.c
  ecma-builtin-atomics.c
  Generating Code...
  Compiling...
  ecma-builtin-bigint-prototype.c
  ecma-builtin-bigint.c
  ecma-builtin-boolean-prototype.c
  ecma-builtin-boolean.c
  ecma-builtin-dataview-prototype.c
  ecma-builtin-dataview.c
  ecma-builtin-date-prototype.c
  ecma-builtin-date.c
  ecma-builtin-error-prototype.c
  ecma-builtin-error.c
  ecma-builtin-evalerror-prototype.c
  ecma-builtin-evalerror.c
  ecma-builtin-function-prototype.c
  ecma-builtin-function.c
  ecma-builtin-generator-function.c
  ecma-builtin-generator-prototype.c
  ecma-builtin-generator.c
  ecma-builtin-global.c
  ecma-builtin-handlers.c
  ecma-builtin-helpers-date.c
  Generating Code...
  Compiling...
  ecma-builtin-helpers-error.c
  ecma-builtin-helpers-json.c
  ecma-builtin-helpers-sort.c
  ecma-builtin-helpers.c
  ecma-builtin-intrinsic.c
  ecma-builtin-iterator-prototype.c
  ecma-builtin-json.c
  ecma-builtin-map-iterator-prototype.c
  ecma-builtin-map-prototype.c
  ecma-builtin-map.c
  ecma-builtin-math.c
  ecma-builtin-number-prototype.c
  ecma-builtin-number.c
  ecma-builtin-object-prototype.c
  ecma-builtin-object.c
  ecma-builtin-promise-prototype.c
  ecma-builtin-promise.c
  ecma-builtin-proxy.c
  ecma-builtin-rangeerror-prototype.c
  ecma-builtin-rangeerror.c
  Generating Code...
  Compiling...
  ecma-builtin-referenceerror-prototype.c
  ecma-builtin-referenceerror.c
  ecma-builtin-reflect.c
  ecma-builtin-regexp-prototype.c
  ecma-builtin-regexp-string-iterator-prototype.c
  ecma-builtin-regexp.c
  ecma-builtin-set-iterator-prototype.c
  ecma-builtin-set-prototype.c
  ecma-builtin-set.c
  ecma-builtin-shared-arraybuffer-prototype.c
  ecma-builtin-shared-arraybuffer.c
  ecma-builtin-string-iterator-prototype.c
  ecma-builtin-string-prototype.c
  ecma-builtin-string.c
  ecma-builtin-symbol-prototype.c
  ecma-builtin-symbol.c
  ecma-builtin-syntaxerror-prototype.c
  ecma-builtin-syntaxerror.c
  ecma-builtin-type-error-thrower.c
  ecma-builtin-typeerror-prototype.c
  Generating Code...
  Compiling...
  ecma-builtin-typeerror.c
  ecma-builtin-urierror-prototype.c
  ecma-builtin-urierror.c
  ecma-builtin-weakmap-prototype.c
  ecma-builtin-weakmap.c
  ecma-builtin-weakref-prototype.c
  ecma-builtin-weakref.c
  ecma-builtin-weakset-prototype.c
  ecma-builtin-weakset.c
  ecma-builtins.c
  ecma-builtin-bigint64array-prototype.c
  ecma-builtin-bigint64array.c
  ecma-builtin-biguint64array-prototype.c
  ecma-builtin-biguint64array.c
  ecma-builtin-float32array-prototype.c
  ecma-builtin-float32array.c
  ecma-builtin-float64array-prototype.c
  ecma-builtin-float64array.c
  ecma-builtin-int16array-prototype.c
  ecma-builtin-int16array.c
  Generating Code...
  Compiling...
  ecma-builtin-int32array-prototype.c
  ecma-builtin-int32array.c
  ecma-builtin-int8array-prototype.c
  ecma-builtin-int8array.c
  ecma-builtin-typedarray-helpers.c
  ecma-builtin-typedarray-prototype.c
  ecma-builtin-typedarray.c
  ecma-builtin-uint16array-prototype.c
  ecma-builtin-uint16array.c
  ecma-builtin-uint32array-prototype.c
  ecma-builtin-uint32array.c
  ecma-builtin-uint8array-prototype.c
  ecma-builtin-uint8array.c
  ecma-builtin-uint8clampedarray-prototype.c
  ecma-builtin-uint8clampedarray.c
  ecma-arguments-object.c
  ecma-array-object.c
  ecma-arraybuffer-object.c
  ecma-async-generator-object.c
  ecma-atomics-object.c
  Generating Code...
  Compiling...
  ecma-big-uint.c
  ecma-bigint-object.c
  ecma-bigint.c
  ecma-boolean-object.c
  ecma-comparison.c
  ecma-container-object.c
  ecma-conversion.c
  ecma-dataview-object.c
  ecma-eval.c
  ecma-exceptions.c
  ecma-function-object.c
  ecma-get-put-value.c
  ecma-iterator-object.c
  ecma-jobqueue.c
  ecma-lex-env.c
  ecma-number-object.c
  ecma-objects-general.c
  ecma-objects.c
  ecma-promise-object.c
  ecma-proxy-object.c
  Generating Code...
  Compiling...
  ecma-reference.c
  ecma-regexp-object.c
  ecma-shared-arraybuffer-object.c
  ecma-string-object.c
  ecma-symbol-object.c
  ecma-typedarray-object.c
  jcontext.c
  jmem-allocator.c
  jmem-heap.c
  jmem-poolman.c
  jrt-fatals.c
  jrt-logging.c
  lit-char-helpers.c
C:\projects\jerryscript\jerry-core\lit\lit-char-helpers.c(141): warning C4018: '<=': signed/unsigned mismatch [C:\projects\jerryscript\build\jerry-core\jerry-core.vcxproj]
C:\projects\jerryscript\jerry-core\lit\lit-char-helpers.c(517): warning C4028: formal parameter 2 different from declaration [C:\projects\jerryscript\build\jerry-core\jerry-core.vcxproj]
  lit-magic-strings.c
  lit-strings.c
  byte-code.c
  common.c
  js-lexer.c
  js-parser-expr.c
  js-parser-line-info-create.c
  Generating Code...
  Compiling...
  js-parser-mem.c
  js-parser-module.c
  js-parser-statm.c
  js-parser-tagged-template-literal.c
  js-parser-util.c
  js-parser.c
  js-scanner-ops.c
  js-scanner-util.c
C:\projects\jerryscript\jerry-core\parser\js\js-scanner-util.c(2257): warning C4090: 'function': different 'const' qualifiers [C:\projects\jerryscript\build\jerry-core\jerry-core.vcxproj]
C:\projects\jerryscript\jerry-core\parser\js\js-scanner-util.c(2486): warning C4090: 'function': different 'const' qualifiers [C:\projects\jerryscript\build\jerry-core\jerry-core.vcxproj]
  js-scanner.c
  parser-errors.c
  re-bytecode.c
  re-compiler.c
  re-parser.c
  opcodes-ecma-arithmetics.c
  opcodes-ecma-bitwise.c
  opcodes-ecma-relational-equality.c
  opcodes.c
  vm-stack.c
  vm-utils.c
  vm.c
  Generating Code...
  jerry-core.vcxproj -> C:\projects\jerryscript\build\lib\Debug\jerry-core.lib
  Building Custom Rule C:/projects/jerryscript/jerry-ext/CMakeLists.txt
  arg-js-iterator-helper.c
  arg-transform-functions.c
  arg.c
  debugger-common.c
  debugger-rp.c
  debugger-serial.c
  debugger-sha1.c
  debugger-tcp.c
  debugger-ws.c
  handle-scope-allocator.c
  handle-scope.c
  module.c
  handlers.c
  print.c
  properties.c
  repl.c
  sources.c
  test262.c
  Generating Code...
  jerry-ext.vcxproj -> C:\projects\jerryscript\build\lib\Debug\jerry-ext.lib
  Building Custom Rule C:/projects/jerryscript/jerry-port/CMakeLists.txt
  jerry-port-context.c
  jerry-port-fs.c
  jerry-port-io.c
  jerry-port-process.c
  jerry-port-unix-date.c
  jerry-port-unix-fs.c
  jerry-port-unix-process.c
  jerry-port-win-date.c
  jerry-port-win-fs.c
  jerry-port-win-process.c
  Generating Code...
```

The following warnings can not be fixed properly by direct cast, as byte code can resident in ready-only ROM,
looking for suggestion.
```
[build] [207/235  82% :: 5.305] Building C object jerry-core\CMakeFiles\jerry-core.dir\parser\js\js-scanner-util.c.obj
[build] E:\CI-Cor\acrop\acrop-deps\acrop-jerry\jerryscript\jerry-core\parser\js\js-scanner-util.c(2257): warning C4090: 'function': different 'const' qualifiers
[build] E:\CI-Cor\acrop\acrop-deps\acrop-jerry\jerryscript\jerry-core\parser\js\js-scanner-util.c(2486): warning C4090: 'function': different 'const' qualifiers
```
The code is
```
        memcpy (&literal.char_p, data_p + 2 + 1, sizeof (uintptr_t));
```

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant