Skip to content

"variable set but not used" error during build of VM #9

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

Closed
DartBot opened this issue Oct 10, 2011 · 3 comments
Closed

"variable set but not used" error during build of VM #9

DartBot opened this issue Oct 10, 2011 · 3 comments
Labels
closed-duplicate Closed in favor of an existing report

Comments

@DartBot
Copy link

DartBot commented Oct 10, 2011

This issue was originally filed by [email protected]


What steps will reproduce the problem?

  1. > Follow steps to build VM mentioned at http://code.google.com/p/dart/wiki/Building#Building_the_standalone_VM

What is the expected output? What do you see instead?
I get some "variable X set but not used"-type warnings, that -Werror escalates to errors, halting the build.
As a temporary measure, I removed -Werror from all *.mk files, which allows me to build the standalone VM successfully.

What version of the product are you using? On what operating system?
Recent svn on arch linux using gcc version 4.6.1 20110819 (prerelease)

Please provide any additional information below.
Here is a full list of the warnings (without -Werror and therefor not turned to errors)

third_party/v8/src/ia32/full-codegen-ia32.cc: In member function ‘virtual void v8::internal::FullCodeGenerator::VisitCompareOperation(v8::internal::CompareOperation*)’:
third_party/v8/src/ia32/full-codegen-ia32.cc:4085:12: warning: variable ‘strict’ set but not used [-Wunused-but-set-variable]
  CXX(host) out/Debug_ia32/obj.host/v8_base/third_party/v8/src/ia32/lithium-gap-resolver-ia32.o
third_party/v8/src/ia32/lithium-codegen-ia32.cc: In member function ‘void v8::internal::LCodeGen::DoLoadKeyedFastDoubleElement(v8::internal::LLoadKeyedFastDoubleElement*)’:
third_party/v8/src/ia32/lithium-codegen-ia32.cc:2235:12: warning: variable ‘elements’ set but not used [-Wunused-but-set-variable]
third_party/v8/src/ia32/lithium-codegen-ia32.cc: In member function ‘void v8::internal::LCodeGen::DoStoreKeyedFastDoubleElement(v8::internal::LStoreKeyedFastDoubleElement*)’:
third_party/v8/src/ia32/lithium-codegen-ia32.cc:3100:12: warning: variable ‘elements’ set but not used [-Wunused-but-set-variable]
third_party/v8/src/ia32/lithium-codegen-ia32.cc:3101:12: warning: variable ‘key’ set but not used [-Wunused-but-set-variable]

third_party/v8/src/ia32/full-codegen-ia32.cc: In member function ‘virtual void v8::internal::FullCodeGenerator::VisitCompareOperation(v8::internal::CompareOperation*)’:
third_party/v8/src/ia32/full-codegen-ia32.cc:4085:12: warning: variable ‘strict’ set but not used [-Wunused-but-set-variable]
  CXX(target) out/Debug_ia32/obj.target/v8_base/third_party/v8/src/ia32/lithium-gap-resolver-ia32.o
third_party/v8/src/ia32/lithium-codegen-ia32.cc: In member function ‘void v8::internal::LCodeGen::DoLoadKeyedFastDoubleElement(v8::internal::LLoadKeyedFastDoubleElement*)’:
third_party/v8/src/ia32/lithium-codegen-ia32.cc:2235:12: warning: variable ‘elements’ set but not used [-Wunused-but-set-variable]
third_party/v8/src/ia32/lithium-codegen-ia32.cc: In member function ‘void v8::internal::LCodeGen::DoStoreKeyedFastDoubleElement(v8::internal::LStoreKeyedFastDoubleElement*)’:
third_party/v8/src/ia32/lithium-codegen-ia32.cc:3100:12: warning: variable ‘elements’ set but not used [-Wunused-but-set-variable]
third_party/v8/src/ia32/lithium-codegen-ia32.cc:3101:12: warning: variable ‘key’ set but not used [-Wunused-but-set-variable]

@DartBot
Copy link
Author

DartBot commented Oct 10, 2011

This comment was originally written by [email protected]


Added Duplicate label.
Marked as being merged into #8.

@DartBot
Copy link
Author

DartBot commented Oct 10, 2011

This comment was originally written by [email protected]


Marked as being merged into #3.

@iposva-google
Copy link
Contributor

corrected duplicate id


Marked as being merged into #43.

@DartBot DartBot added Type-Defect closed-duplicate Closed in favor of an existing report labels Oct 11, 2011
copybara-service bot pushed a commit that referenced this issue Oct 22, 2024
See: b/374689139.

https://dart-review.googlesource.com/c/sdk/+/390941 is blocking an SDK roll.

Root cause:


```
Action threw an exception: type 'ConstructorMember' is not a subtype of type 'ConstructorFragment' in type cast
#0      InterfaceTypeImpl.constructors2.<anonymous closure> (package:analyzer/src/dart/element/type.dart:569)
#1      MappedListIterable.elementAt (dart:_internal/iterable.dart:435)
#2      ListIterator.moveNext (dart:_internal/iterable.dart:364)
#3      new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:189)
#4      new _GrowableList.of (dart:core-patch/growable_array.dart:150)
#5      new List.of (dart:core-patch/array_patch.dart:39)
#6      ListIterable.toList (dart:_internal/iterable.dart:224)
#7      InterfaceTypeImpl.constructors2 (package:analyzer/src/dart/element/type.dart:570)
#8      _Visitor._hasConstConstructorInvocation (package:linter/src/rules/prefer_const_constructors_in_immutables.dart:110)
#9      _Visitor.visitConstructorDeclaration (package:linter/src/rules/prefer_const_constructors_in_immutables.dart:58)
```


To verify the fix locally:

```
  solo_test_X() async {
    await assertNoErrorsInCode(r'''
class A<T> {}
''');

    var A = findElement.class_('A').instantiate(
      typeArguments: [intType],
      nullabilitySuffix: NullabilitySuffix.none,
    );
    A.constructors2;
  }
```


Bug: b/374689139
Change-Id: I70034d938d840dc0c3939db27e7116164e4617e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/391483
Reviewed-by: Konstantin Shcheglov <[email protected]>
Commit-Queue: Phil Quitslund <[email protected]>
copybara-service bot pushed a commit that referenced this issue Feb 21, 2025
This test has a few independent calls to asyncExpectThrows which uses
asyncStart/asyncEnd. However, multiple top-level asyncStart/asyncEnd
are not allowed, which causes the following flaky error:

```
Unhandled exception:
Exception: Fatal: asyncStart() was called even though we are done with testing.. This is most likely a bug in your test.
#0      asyncStart (package:expect/async_helper.dart:53)
#1      asyncExpectThrows (package:expect/async_helper.dart:140)
#2      testMalformedAuthenticateHeaderWithAuthHandler.<anonymous closure> (file:///b/s/w/ir/cache/builder/sdk/tests/standalone/io/http_auth_digest_test.dart:345)
#3      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:951)
#4      Future._propagateToListeners (dart:async/future_impl.dart:980)
#5      Future._completeWithValue (dart:async/future_impl.dart:723)
#6      Future._asyncCompleteWithValue.<anonymous closure> (dart:async/future_impl.dart:807)
#7      _microtaskLoop (dart:async/schedule_microtask.dart:40)
#8      _startMicrotaskLoop (dart:async/schedule_microtask.dart:49)
#9      _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:128)
#10     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:195)

--- Re-run this test:
python3 tools/test.py -n vm-aot-ubsan-linux-release-x64 standalone/io/http_auth_digest_test
```

This change attempts to fix this by adding a top-level asyncStart/asyncEnd
and also asyncStart/asyncEnd to the server start/shutdown to
enclose each test case into asyncStart/asyncEnd and avoid printing
"unittest-suite-success" marker before all test cases are finished.

TEST=standalone/io/http_auth_digest_test

Change-Id: I950e7c6c09f5c2144da874ab3be3cd3a130d3790
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411086
Commit-Queue: Alexander Markov <[email protected]>
Reviewed-by: Alexander Aprelev <[email protected]>
copybara-service bot pushed a commit that referenced this issue May 1, 2025
This is an attempt to fix flaky failure

```
Unhandled exception:
Exception: Fatal: asyncStart() was called even though we are done with testing.. This is most likely a bug in your test.
#0      asyncStart (package:expect/async_helper.dart:53)
#1      asyncExpectThrows (package:expect/async_helper.dart:140)
#2      testMalformedAuthenticateHeaderWithAuthHandler.<anonymous closure> (file:///C:/b/s/w/ir/tests/standalone/io/http_auth_test.dart:263)
#3      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:951)
#4      Future._propagateToListeners (dart:async/future_impl.dart:980)
#5      Future._completeWithValue (dart:async/future_impl.dart:723)
#6      Future._asyncCompleteWithValue.<anonymous closure> (dart:async/future_impl.dart:807)
#7      _microtaskLoop (dart:async/schedule_microtask.dart:42)
#8      _startMicrotaskLoop (dart:async/schedule_microtask.dart:60)
#9      _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:127)
#10     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:194)

--- Re-run this test:
python3 tools/test.py -n vm-aot-win-release-x64 standalone/io/http_auth_test
```

The test has multiple calls to asyncExpectThrows which uses
asyncStart/asyncEnd, but only one top-level asyncStart/asyncEnd is
allowed.

In addition to a top-level asyncStart/asyncEnd, also add
asyncStart/asyncEnd around creation and shutdown of the server in order
to make sure all test cases are completed before test is finished.

TEST=standalone/io/http_auth_test

Change-Id: Ibb55dbae2c2e48e18f51f9a0adc24101d6121a8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425600
Reviewed-by: Brian Quinlan <[email protected]>
Commit-Queue: Alexander Markov <[email protected]>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-duplicate Closed in favor of an existing report
Projects
None yet
Development

No branches or pull requests

2 participants