This repository was archived by the owner on Sep 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
This repository was archived by the owner on Sep 15, 2025. It is now read-only.
Warnings from protoc: Import google/api/annotations.proto is unused #124
Copy link
Copy link
Open
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Environment details
- Programming language: C++
- OS: Ubuntu 22.04
- Language runtime version: Protobuf 3.12.4
- Package version: 1.50.0
Steps to reproduce
- Run
protocon all the.protofiles - The following warnings are reported:
google/api/auth.proto:19:1: warning: Import google/api/annotations.proto is unused.
google/api/billing.proto:19:1: warning: Import google/api/annotations.proto is unused.
google/api/endpoint.proto:19:1: warning: Import google/api/annotations.proto is unused.
google/api/logging.proto:19:1: warning: Import google/api/annotations.proto is unused.
google/api/monitoring.proto:19:1: warning: Import google/api/annotations.proto is unused.
google/api/quota.proto:19:1: warning: Import google/api/annotations.proto is unused.
google/api/service.proto:19:1: warning: Import google/api/annotations.proto is unused.
google/api/usage.proto:19:1: warning: Import google/api/annotations.proto is unused.
google/iam/v1/logging/audit_data.proto:19:1: warning: Import google/api/annotations.proto is unused.
google/iam/v1/policy.proto:19:1: warning: Import google/api/annotations.proto is unused.
google/logging/type/http_request.proto:19:1: warning: Import google/api/annotations.proto is unused.
google/logging/type/log_severity.proto:19:1: warning: Import google/api/annotations.proto is unused.- The generation then completes successfully
Discussion
These warnings don't break anything, but they are a false positive. They waste our and our user's time by bringing attention to a non-existent problem. We could disable printing of all Protobuf warnings in our build setup, but then we could miss some actually important issues.
I suggest to remove the specified unused includes from those files. Or is there a flag I can pass to protoc to silence specifically "unused import" warnings?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.