https://github.com/protobuf-c/protobuf-c/issues/795#issuecomment-3976758749

Index: protoc-gen-c/c_string_field.cc
--- protoc-gen-c/c_string_field.cc.orig
+++ protoc-gen-c/c_string_field.cc
@@ -94,7 +94,7 @@ void StringFieldGenerator::GenerateStructMembers(googl
 {
   const ProtobufCFileOptions opt = descriptor_->file()->options().GetExtension(pb_c_file);
 
-  switch (descriptor_->label()) {
+  switch (FieldLabel(descriptor_)) {
     case google::protobuf::FieldDescriptor::LABEL_REQUIRED:
     case google::protobuf::FieldDescriptor::LABEL_OPTIONAL:
       if (opt.const_strings())
@@ -138,7 +138,7 @@ void StringFieldGenerator::GenerateStaticInit(google::
   } else {
     vars["default"] = "(char *)protobuf_c_empty_string";
   }
-  switch (descriptor_->label()) {
+  switch (FieldLabel(descriptor_)) {
     case google::protobuf::FieldDescriptor::LABEL_REQUIRED:
     case google::protobuf::FieldDescriptor::LABEL_OPTIONAL:
       printer->Print(vars, "$default$");
