tags:

views:

22

answers:

1

is there a option in gcc compiler/ pclint for error/warning for int to long conversion.

+2  A: 

Int to long should be OK. For long to int see , -Wconversion:

int main() {
    long long l = 0;
    int n = l;
}

then

gcc -Wconversion wc.c

gives:

wc.c:3: warning: conversion to 'int' from 'long long int' may alter its value
anon