This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/16458] New: endian.h macros return integers of wrong type


https://sourceware.org/bugzilla/show_bug.cgi?id=16458

            Bug ID: 16458
           Summary: endian.h macros return integers of wrong type
           Product: glibc
           Version: 2.17
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: jaak at ristioja dot ee
                CC: drepper.fsp at gmail dot com

#define _BSD_SOURCE
#include <endian.h>
#include <stdint.h>

int main() {
  const long int i = 42;
  const uint64_t b = htole64(i);
  return (int) b;
}

$ gcc -Wsign-conversion test.c -o test
test.c: In function 'main':
test.c:7:3: warning: conversion to 'uint64_t' from 'long int' may change the
sign of the result [-Wsign-conversion]

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]