Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.
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

@Anton3

Description

@Anton3

Environment details

  • Programming language: C++
  • OS: Ubuntu 22.04
  • Language runtime version: Protobuf 3.12.4
  • Package version: 1.50.0

Steps to reproduce

  1. Run protoc on all the .proto files
  2. 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.
  1. 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p2Moderately-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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions