-
Notifications
You must be signed in to change notification settings - Fork 16
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
Infinite loop if function call in a comment #58
Comments
what is the content of file.c? |
I just found the cause of the problem. this is my c: #include "libft.h"
/*
The bzero() function erases the data in the n bytes of the memory starting at the location pointed to by s, by writing zeros (bytes containing '\0') to that area.
The explicit_bzero() function performs the same task as bzero(). It differs from bzero() in that it guarantees that compiler optimizations will not remove the erase operation if the compiler deduces that the operation is "un‐necessary".
*/
void bzero(void *s, size_t n)
{
unsigned char *ptr_s;
} I just found out that 42 does not allow the comment above function. |
Indeed, the comment is the issue, it's still a bug because it shouldn't hang like this. if I remove the |
@keyhr, I see it hangs in the (I don't think it needs to be correctly formatted but would be nice if it didn't hang)
|
I try update the comment and this format is working: /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_bzero.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: npattana <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/08/28 14:57:50 by hui #+# #+# */
/* Updated: 2023/08/28 18:12:26 by npattana ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/*
The function erases the data in the n bytes of the memory starting at the
location pointed to by s, by writing zeros (bytes containing '\0') to that area.
*/
void bzero(void *s, size_t n)
{
unsigned char *ptr_s;
} |
Working on a fix... |
I have tested it, and the infinite loop that causes freezing is gone. Thanks. |
$ c_formatter_42 < file.c
$ python3 -m c_formatter_42 < file.c
not showing any output and freeze.
The text was updated successfully, but these errors were encountered: