You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2020/08/07 03:46:11 UTC

[GitHub] [incubator-brpc] DepInjoy opened a new issue #1198: BRPC静态变量导致和第三方库冲突

DepInjoy opened a new issue #1198:
URL: https://github.com/apache/incubator-brpc/issues/1198


   #**Describe the bug (描述bug)**
   0.9.7-rc03进行开发 当然在工程中也使用了其他的第三方库比如gutil-1.0,这两个库都对一些常用的数值范围进行了定义,比如uint8Max和uint8Min,他们都是static便令 这样便以为着如果在头文件中同时包含他们可能会出现重复定义的问题。
   
   **To Reproduce (复现方法)**
   创建一个源代码 同时包含BRPC的butil\basictypes.h以及gutil-1.0库的gutil/port.h文件。编译便可以复现
   
   **Expected behavior (期望行为)**
   从代码规范的角度来说,静态变量是需要谨慎的,可以将他们限制在某一个命名区间内,来在一定程度上限制他们的作用范围。
   
   **Versions (各种版本)**
   OS:Linux
   Compiler: g++
   brpc:0.9.7-rc03
   protobuf:
   
   **Additional context/screenshots (更多上下文/截图)**
   ![冲突](https://user-images.githubusercontent.com/41673122/89606714-5117bb00-d8a3-11ea-8b0f-bd9e04f1cc29.png)
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] gydong commented on issue #1198: BRPC静态变量导致和第三方库冲突

Posted by GitBox <gi...@apache.org>.
gydong commented on issue #1198:
URL: https://github.com/apache/incubator-brpc/issues/1198#issuecomment-674623235


   这种变量如果定义在命名空间内,就大大降低易用性了。如果其中一个文件定义的变量是另一个的子集,那只需要include多的那个即可,如果两者存在不完全重复部分,那么就得自行定义其中一部分变量了


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] DepInjoy closed issue #1198: BRPC静态变量导致和第三方库冲突

Posted by GitBox <gi...@apache.org>.
DepInjoy closed issue #1198:
URL: https://github.com/apache/incubator-brpc/issues/1198


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] DepInjoy commented on issue #1198: BRPC静态变量导致和第三方库冲突

Posted by GitBox <gi...@apache.org>.
DepInjoy commented on issue #1198:
URL: https://github.com/apache/incubator-brpc/issues/1198#issuecomment-736954347


   嗯嗯 谢谢你打答疑


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org