Delete last node in singly linked list In a TED talk Linus Torvalds made a point about “good taste” at approximately 14:10 in the interview. I read through his examples of “bad taste” and “good taste” and wanted to implement the same principle for a function that deletes the last node in a singly linked list. I also followed his coding style.
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;

/* linked list structure */
struct node {
    int data;
    struct node *next;
};

/* create new node */
struct node *new_node(int data, struct node *next)
{
    struct node *new = malloc(sizeof *new);
    if (!new) {
        fprintf(stderr, &quot;Error: memory allocation failed\n&quot;);
        exit(EXIT_FAILURE);
    }
    new-&gt;data = data;
    new-&gt;next = next;
    return new;
}

/* delete last node */
void delete_last(struct node *head)
{
    if (head == NULL) {
        fprintf(stderr, &quot;Error: linked list underflow\n&quot;);
        exit(EXIT_FAILURE);
    }
    struct node **cursor = &amp;head;
    while ((*cursor)-&gt;next != NULL)
        cursor = &amp;(*cursor)-&gt;next;
    free(*cursor);
    *cursor = NULL;
}
I also followed [Torvalds'] coding style

I'm all for coding style standards, though I decline to listen to all of his suggestions simply because he's the loudest (seriously, very very loud) voice in the room. His blind obedience to 1988's K&amp;R with no other rationale I find short-sighted as well. Anyway, enough editorializing:
Your non-parenthesized sizeof *new falls on a matter in his guide that is a little ambiguous -

The notable exceptions are sizeof, typeof, alignof, and __attribute__, which look somewhat like functions (and are usually used with parentheses in Linux, although they are not required in the language)

Whereas parens are not required after sizeof, I see them in the majority of code I encounter so I'd recommend sticking with them.
I warn against writing keywords from C++ as symbol names in C, in this case new. If ever you want this to be readily C++-compatible, this will cause you grief.