g++ strlen() returns incorrect length 0 on Zero-Length Array

Solution Verified - Updated -

Issue

  • g++ strlen() returns incorrect length 0 on Zero-Length Array

Environment

  • Red Hat Enterprise Linux 8
  • GNU Compiler Collection gcc-8.5.0-15.el8
  • C++ source with Zero Length Array in struct like name[0]

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content