[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Indent breaks hex float literals

From: Moshe Benezra
Subject: Indent breaks hex float literals
Date: Sun, 15 Mar 2015 04:56:56 -0400

(I couldn’t find reference to this problem in the archive or on line) :

C can recognize float in hex float literals, for example:

#include <stdio.h>
double    pi = 0x1.921fb54442d18p+1;
int main()
    printf("%17.15lf\n", pi);
    return 0;

However, when gnu-indent is applied to this program it replaces the hex
float with:

double    pi = 0x1 .921 fb54442d18p + 1;

which results with a compilation error (clang):

pi1.c:3:17: error: expected ';' after top level declarator
double          pi = 0x1 .921 fb54442d18p + 1;

It is possible, of course, to disable indent for  line containing hex float
but that would clutter the source.

I greatly appreciate your help,


--Moshe Ben-Ezra

reply via email to

[Prev in Thread] Current Thread [Next in Thread]