Skip to content

Won't compile with GCC 15 (with default options) #43

@rostislav-nikitin

Description

@rostislav-nikitin

Problem
GCC versions before GCC 15 defaulted to the GNU C89 standard (-std=gnu89 or similar), which still allowed the old-style syntax for backward compatibility. With GCC 15, the default has changed to C23 (-std=gnu23), where the old syntax is no longer valid. Code using this style will now cause a compilation error.

/* Old-style function definition */
int max(a, b)
int a, b;
{
return a > b ? a : b;
}

Fix
Use compiler option: -std=gnu89

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions