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

Incorrect C code generation when trying to echo a Lock variable #12855

Closed
ghost opened this issue Dec 8, 2019 · 14 comments
Closed

Incorrect C code generation when trying to echo a Lock variable #12855

ghost opened this issue Dec 8, 2019 · 14 comments

Comments

@ghost
Copy link

ghost commented Dec 8, 2019

Bad C code is generated with the following Nim code:

Example

import locks

var l: Lock
echo l

Current Output

CC: ltest.nim
Error: execution of an external compiler program 'gcc -c  -w  -I/home/tay/.choosenim/toolchains/nim-1.0.4/lib -I/home/tay -o /home/tay/.cache/nim/ltest_d/stdlib_dollars.nim.c.o /home/tay/.cache/nim/ltest_d/stdlib_dollars.nim.c' failed with exit code: 1

/home/tay/.cache/nim/ltest_d/stdlib_dollars.nim.c: In function ‘dollar___3Dq1hcGH7a2iNlnh4hnPbg’:
/home/tay/.cache/nim/ltest_d/stdlib_dollars.nim.c:219:50: error: ‘pthread_mutex_t’ {aka ‘union <anonymous>’} has no member named ‘abi’
  219 |  addQuoted__N56rmvBL9a3xqnKq09cKdb3A((&result), x.abi);
      |                                                  ^

Expected Output

Compiler either compiles properly or errors before C code gen

Possible Solution

  • It looks like there might be an issue with the implementation of $ for the Lock type

Additional Information

  • Fedora 31: Linux localhost.localdomain 5.3.11-300.fc31.x86_64 #1 SMP Tue Nov 12 19:08:07 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
$ nim -v
Nim Compiler Version 1.0.4 [Linux: amd64]
Compiled at 2019-11-27
Copyright (c) 2006-2019 by Andreas Rumpf

git hash: c8998c498f5e2a0874846eb31309e1d1630faca6
active boot switches: -d:release
@ghost ghost closed this as completed Apr 19, 2020
@ghost
Copy link

ghost commented Apr 19, 2020

Why close? The issue is still there

@Araq Araq reopened this Apr 19, 2020
@ghost
Copy link
Author

ghost commented Apr 20, 2020

It's been several months and there was no feedback, I figured an issue wasn't necessary.

@ghost
Copy link

ghost commented Apr 20, 2020

@3n-k1 that's not how it works in open-source in general - it just means that nobody worked on the issue yet, but as long as the bug is still there it should be open

@ghost
Copy link
Author

ghost commented Apr 21, 2020

I understand how FOSS works. Now, I would prefer if you didn't mention me again as I would prefer not to receive notifications for this.

@ghost
Copy link
Author

ghost commented Jul 1, 2020

It's been over half a year, and I get a bad taste in my mouth every time I see this. I'm closing this, and I will be blocking anyone who responds or re-opens; I really don't care if that makes me an ass.

Y'all have a minimal example and all the information necessary for this, feel free to open a new issue with a copy-paste of the initial issue I posted here.

This is me officially leaving the Nim community. So long, and thanks for all the fish.

@ghost ghost closed this as completed Jul 1, 2020
@ghost
Copy link

ghost commented Jul 1, 2020

It's been over half a year, and I get a bad taste in my mouth every time I see this. I'm closing this, and I will be blocking anyone who responds or re-opens; I really don't care if that makes me an ass.

Y'all have a minimal example and all the information necessary for this, feel free to open a new issue with a copy-paste of the initial issue I posted here.

This is me officially leaving the Nim community. So long, and thanks for all the fish.

I'm okay with getting blocked by you - but really, "leaving" the community because of INCORRECT Nim code not compiling (even if it compiles it'll crash at best since you didn't initialize the lock, and for printing you can just try to use repr or cast to a pointer and repr) is not okay. Also this is open source, not some software you paid for, so you maybe should've tried fixing it yourself before? :)

@beef331
Copy link
Collaborator

beef331 commented Jul 1, 2020

Just brigading so I can get my promised block. I certainly would not like you to use anything I contribute on.

@ghost
Copy link
Author

ghost commented Jul 1, 2020

@Yardanico I'm leaving the community because Araq has treated me like shit numerous times, but thanks for playing.

@ghost
Copy link
Author

ghost commented Jul 1, 2020

The fact you need to bitch and moan about someone not wanting to be treated like a fucking piece of garbage just confirms this community is fucking garbage.

@ghost
Copy link
Author

ghost commented Jul 1, 2020

@beef331 Even if I did want to use any of your trash, it would be a bit difficult since you apparently can't bring yourself to write more than two sentences in a readme, assuming you write anything at all.

Nice website by the way, I really enjoy the gif of your superman64 clone playing as the site's background.

You wanna get shitty? Let's fuckin' go, kid. At least I actually contributed to Nim before Araq treated me like shit, unlike you.

Araq, be careful who you treat like garbage, you may lose one of your shitty niche language's biggest evangelists.

@ghost
Copy link
Author

ghost commented Jul 1, 2020

Am I ranting now? Sure the fuck am. I thought you'd all be able to be fucking adults about this, but I guess fucking not.

@ghost
Copy link
Author

ghost commented Jul 1, 2020

@Yardanico I tried to be as polite as possible when closing this, and you attempt to dogpile and bitch? Real fucking mature.
image

@ghost
Copy link
Author

ghost commented Jul 1, 2020

just gonna document why I'm leaving. You're all petulant children.
image

@ghost
Copy link
Author

ghost commented Jul 1, 2020

Please do google "inurl:irclogs.nim-lang.org simula". Better yet, search "from:simula#3097" in the discord server. My last interaction is exactly the bullshit I'm talking about. Glad to see it hasn't ended.
image

@nim-lang nim-lang locked as too heated and limited conversation to collaborators Jul 1, 2020
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants