Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I asked ChatGPT to make a system of macros that would generate a struct with given fields (for example: int a, bool b, char *c) and a function that would print the struct contents. Instead of refusing it started inventing recursive macros that were never going to work. It seems LLMs are especially bad with C macros.

If you have access to state-of-art coding assistants, try asking this. You can additionally add a requirement to generate a destructor function (that would free dynamically-allocated fields).



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: