goplus / c2go

Convert C to Go
Apache License 2.0
306 stars 21 forks source link

autoStaticName check current func name #151

Closed visualfc closed 2 years ago

visualfc commented 2 years ago

static name check current func orgname _cgos_fnName_staticName_fileBase

fix https://github.com/goplus/c2go/issues/148 bug1

main.c

void a() {
  static int a = 1;
}

int main() {
  a();
}

c2go main.c

package main

import os "os"

func a() {
}

var _cgos_a_a_main int32 = int32(1)

func _cgo_main() int32 {
    a()
    return 0
}
func main() {
    os.Exit(int(_cgo_main()))
}
codecov-commenter commented 2 years ago

Codecov Report

Base: 88.79% // Head: 88.80% // Increases project coverage by +0.01% :tada:

Coverage data is based on head (79b6a00) compared to base (63194d8). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #151 +/- ## ========================================== + Coverage 88.79% 88.80% +0.01% ========================================== Files 10 10 Lines 3337 3341 +4 ========================================== + Hits 2963 2967 +4 Misses 293 293 Partials 81 81 ``` | [Impacted Files](https://codecov.io/gh/goplus/c2go/pull/151?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goplus) | Coverage Δ | | |---|---|---| | [cl/blockctx.go](https://codecov.io/gh/goplus/c2go/pull/151/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goplus#diff-Y2wvYmxvY2tjdHguZ28=) | `86.30% <100.00%> (+0.04%)` | :arrow_up: | | [cl/compile.go](https://codecov.io/gh/goplus/c2go/pull/151/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goplus#diff-Y2wvY29tcGlsZS5nbw==) | `95.02% <100.00%> (ø)` | | | [cl/multifiles.go](https://codecov.io/gh/goplus/c2go/pull/151/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goplus#diff-Y2wvbXVsdGlmaWxlcy5nbw==) | `93.70% <100.00%> (+0.13%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goplus). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goplus)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.