Подробности
        
                          [В начало]
Проблема в реализации № D0056
Краткое описание
Несоответствие между стандартом и реализацией функции "g_key_file_get_integer"
Подробное описание
В документации для функции g_key_file_get_integer сказано: "Returns the value associated with key under group_name as an integer. If group_name is NULL, the start_group is used.". В то же время вызов функции с параметром "group_name = NULL" приводит к следующему сообщению об ошибке: "GLib-CRITICAL **: g_key_file_get_integer: assertion `group_name != NULL' failed".
Раздел стандарта
Linux Standard Base Desktop Specification 3.1, Chapter 12. Libraries, 12.2 Interfaces for libglib-2.0; http://www.gtk.org/api/2.6/glib/glib-Key-value-file-parser.html#g-key-file-get-integer
Пример
#include <stdio.h>
#include <string.h>
#include <glib.h>
char *text = "[Another Group]\nNumbers=2;20;-200;0\n\nInteger=200\n\n"\
    "IntegerList=-10;3;0;100\n\nBooleanList=true;false;true;true\n\n "\
    "False=false\nTrue=true\n\nString=String\n\nStringList=Hello;Hi\n"\
    "StringList[it]=Ciao;Hi";
#define KEY "Integer"
int main ()
{
    GKeyFile *gkf = NULL;
    gkf=g_key_file_new ();
    g_key_file_load_from_data (gkf, text, strlen (text), G_KEY_FILE_NONE, NULL);
    g_key_file_get_integer (gkf, NULL, KEY, NULL);
    return 0;
}
                    Компонент
gtk-glib 2.6.2 or later
Принято
Gnome Bugzilla 477658
Статус
Исправлено в gtk-glib - 2.16
[В начало]