42School / norminette

Official 42 norminette
MIT License
956 stars 140 forks source link

Multiple instructions in return #497

Open Qpupier opened 4 months ago

Qpupier commented 4 months ago

Description Multiple instructions in a return don't make an error

Exemple

/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   test.c                                             :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: Kunfandi <kunfandi@42lyon.fr>              +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2024/06/10 17:15:35 by Kunfandi          #+#    #+#             */
/*   Updated: 2024/06/10 17:17:20 by Kunfandi         ###   ########lyon.fr   */
/*                                                                            */
/* ************************************************************************** */

#include <stdio.h>

int main(void)
{
    return (printf("OK\n"), 0);
}

This file is good with the norminette but it shouldn't.

Additional infos norminette 3.3.55

BWG31 commented 1 month ago

I'd be very curious to know an official opinion on the matter.

The norm (v4) III.2 (Formatting) states: "One instruction per line." I think the use of the word "instruction" is confusion and perhaps should be "statement"?

return(function_call(), 0); This is one statement (return) containing two expressions.

if (ft_isprint(c) && ft_isdigit(c)) This is also one statement (if) containing two expressions.

if (ft_isprint(c), ft_isdigit(c)) Same again (silly but norm friendly).

My thoughts: