Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type C.bool is undfined #3956

Closed
Patrick0308 opened this issue Oct 16, 2023 · 5 comments
Closed

type C.bool is undfined #3956

Patrick0308 opened this issue Oct 16, 2023 · 5 comments
Labels
duplicate This issue or pull request already exists

Comments

@Patrick0308
Copy link

Environment:

tinygo version: 0.30.0
operating System: macOS
architecture: aarch64

Description:

Compilation brakes with an undefined C._Bool

Steps to reproduce:

Given the following Go-code:

package main

/*
  #include "stdbool.h"
*/
import "C"

import "fmt"

func main() {
	fmt.Printf("%s", C.bool(true))
}

Run

tinygo run main.go

Expected behavior:

❯ tinygo run main.go
%!s(main._Ctype__Bool=true)%    

Actual behavior:

❯ tinygo run main.go
# command-line-arguments
../../../../opt/homebrew/Cellar/tinygo/0.30.0/lib/clang/include/stdbool.h:20:14: undefined: C._Bool
@Gustavomurta
Copy link

Gustavomurta commented Oct 17, 2023

I´m not SW expert, but searching this argument - #include "stdbool.h" , I found this:

#include <stdbool.h> (In Go, this syntax is different)

@Patrick0308
Copy link
Author

Patrick0308 commented Oct 20, 2023

https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html

The difference between "stdbool.h" and <stdbool.H> is searching path. However it doesn't matter on this case.
<stdbool.H> failed too.

@deadprogram
Copy link
Member

This was corrected in #3928 which will be part of the next release.

@deadprogram deadprogram added duplicate This issue or pull request already exists next-release Will be part of next release labels Oct 23, 2023
@Patrick0308
Copy link
Author

Patrick0308 commented Oct 24, 2023

@deadprogram I tested with dev branch. This case still failed.

@deadprogram
Copy link
Member

Completed with v0.31.0 so now closing. Thank you!

@deadprogram deadprogram removed the next-release Will be part of next release label Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants