Bonjour,

J'essaye de compiler la bibliothèque serialib (http://serialib.free.fr/html/index.html) pour la gestion des ports série. Je compile sous Linux et j'ai l'erreur suivante :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
.../serialib.cpp:337:38: attention : converting to non-pointer type ‘unsigned int’ from NULL [-Wconversion-null]
Elle concerne la fonction suivante à la ligne 7 :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
int serialib::ReadStringNoTimeOut(char *String,char FinalChar,unsigned int MaxNbBytes)
{
    unsigned int    NbBytes=0;                                          // Number of bytes read
    char            ret;                                                // Returned value from Read
    while (NbBytes<MaxNbBytes)                                          // While the buffer is not full
    {                                                                   // Read a byte with the restant time
        ret=ReadChar(&String[NbBytes]);
        if (ret==1)                                                     // If a byte has been read
        {
            if (String[NbBytes]==FinalChar)                             // Check if it is the final char
            {
                String  [++NbBytes]=0;                                  // Yes : add the end character 0
                return NbBytes;                                         // Return the number of bytes read
            }
            NbBytes++;                                                  // If not, just increase the number of bytes read
        }
        if (ret<0) return ret;                                          // Error while reading : return the error number
    }
    return -3;                                                          // Buffer is full : return -3
}
Avez-vous des idées pour corriger ça ?

Merci d'avance !