meetecho / janus-gateway

Janus WebRTC Server
https://janus.conf.meetecho.com
GNU General Public License v3.0
8.22k stars 2.48k forks source link

to solve compiling error "diagnostic" in GCC 4.4.X and lower #1942

Closed chengmo03013106 closed 4 years ago

chengmo03013106 commented 4 years ago

https://github.com/meetecho/janus-gateway/blob/5b0aa041cd2ef50bdba100f162acbc14d641067a/rtp.c#L66

I faced the error "#pragma GCC diagnostic not allowed inside functions" durning compiling. to solve this I added #if defined(GNUC) && GNUC >= 5 and #endif warpped the L66.

It worked fine on my case.

Hope helpful.

lminiero commented 4 years ago

gcc 4.x is very old, though...

Not sure why only adding the #if/#endif around line 66 fixes it for you, since just a couple of lines below there's another #pragma to restore the diagnostic. Shouldn't you add the same for line 68 as well?

chengmo03013106 commented 4 years ago

gcc 4.x is very old, though...

Not sure why only adding the #if/#endif around line 66 fixes it for you, since just a couple of lines below there's another #pragma to restore the diagnostic. Shouldn't you add the same for line 68 as well?

Yep, that's right. I did so in each "#paragma ... diagnostic" parts. Two of them in rtp.c, Another two parts in utils.c, line 289 , 300

lminiero commented 4 years ago

Please provide a pull request which includes all the fixes you need, and we'll review it. We don't have access to such an old version of the compiler, and so wouldn't be able to verify our changes fix it.

chengmo03013106 commented 4 years ago

Please provide a pull request which includes all the fixes you need, and we'll review it. We don't have access to such an old version of the compiler, and so wouldn't be able to verify our changes fix it.

I am sorry that I can not sure the pull request because the codes were from my team. The only thing I am sure is jauns version "const char *janus_version_string = "0.6.0";" which located in version.c

It might not be necessary to be fixed for my old version compiler.

lminiero commented 4 years ago

Version 0.6.0 is very old. Considering this is related to a very old gcc version (which I guess isn't very common anymore), I'll close the issue: if you still feel it should be solved, please contribute a fix and we'll review.

chengmo03013106 commented 4 years ago

Version 0.6.0 is very old. Considering this is related to a very old gcc version (which I guess isn't very common anymore), I'll close the issue: if you still feel it should be solved, please contribute a fix and we'll review.

That's all right. Thank you for all the things