README.in: Note undefined behavior with new g_type_init() -> ctor change
[platform/upstream/glib.git] / README.in
1 General Information
2 ===================
3
4 This is GLib version @GLIB_VERSION@. GLib is the low-level core
5 library that forms the basis for projects such as GTK+ and GNOME. It
6 provides data structure handling for C, portability wrappers, and
7 interfaces for such runtime functionality as an event loop, threads,
8 dynamic loading, and an object system.
9
10 The official download locations are:
11   ftp://ftp.gtk.org/pub/glib
12   http://download.gnome.org/sources/glib
13
14 The official web site is:
15   http://www.gtk.org/
16
17 Information about mailing lists can be found at
18   http://www.gtk.org/mailing-lists.php
19
20 To subscribe, send mail to gtk-list-request@gnome.org
21 with the subject "subscribe".
22
23 Installation
24 ============
25
26 See the file 'INSTALL'
27
28 How to report bugs
29 ==================
30
31 Bugs should be reported to the GNOME bug tracking system.
32 (http://bugzilla.gnome.org, product glib.) You will need
33 to create an account for yourself.
34
35 In the bug report please include:
36
37 * Information about your system. For instance:
38
39    - What operating system and version
40    - For Linux, what version of the C library
41
42   And anything else you think is relevant.
43
44 * How to reproduce the bug.
45
46   If you can reproduce it with one of the test programs that are built
47   in the tests/ subdirectory, that will be most convenient.  Otherwise,
48   please include a short test program that exhibits the behavior.
49   As a last resort, you can also provide a pointer to a larger piece
50   of software that can be downloaded.
51
52 * If the bug was a crash, the exact text that was printed out
53   when the crash occured.
54
55 * Further information such as stack traces may be useful, but
56   is not necessary.
57
58 Patches
59 =======
60
61 Patches should also be submitted to bugzilla.gnome.org. If the
62 patch fixes an existing bug, add the patch as an attachment
63 to that bug report.
64
65 Otherwise, enter a new bug report that describes the patch,
66 and attach the patch to that bug report.
67
68 Patches should be in unified diff form. (The -up option to GNU diff.)
69
70 Notes about GLib 2.36
71 =====================
72
73 * It is no longer necessary to call g_type_init().  If you are
74   loading GLib as a dynamic module, you should be careful to avoid
75   unloading it, then subsequently loading it again.  This never
76   really worked before, but it is now explicitly undefined behavior.
77
78 Notes about GLib 2.34
79 =====================
80
81 * GIO now looks for thumbnails in XDG_CACHE_HOME, following a
82   recent alignment of the thumbnail spec with the basedir spec.
83
84 * The default values for GThreadPools max_unused_threads and
85   max_idle_time settings have been changed to 2 and 15*1000,
86   respectively.
87
88 Notes about GLib 2.32
89 =====================
90
91 * It is no longer necessary to use g_thread_init() or to link against
92   libgthread.  libglib is now always thread-enabled. Custom thread
93   system implementations are no longer supported (including errorcheck
94   mutexes).
95
96 * The thread and synchronisation APIs have been updated.
97   GMutex and GCond can be statically allocated without explicit
98   initialisation, as can new types GRWLock and GRecMutex.  The
99   GStatic_______ variants of these types have been deprecated.  GPrivate
100   can also be statically allocated and has a nicer API (deprecating
101   GStaticPrivate).  Finally, g_thread_create() has been replaced with a
102   substantially simplified g_thread_new().
103
104 * The g_once_init_enter()/_leave() functions have been replaced with
105   macros that allow for a pointer to any gsize-sized object, not just a
106   gsize*.  The assertions to ensure that a pointer to a correctly-sized
107   object is being used will not work with generic pointers (ie: (void*)
108   and (gpointer) casts) which would have worked with the old version.
109
110 * It is now mandatory to include glib.h instead of individual headers.
111
112 * The -uninstalled variants of the pkg-config files have been dropped.
113
114 * For a long time, gobject-2.0.pc mistakenly declared a public
115   dependency on gthread-2.0.pc (when the dependency should have been
116   private).  This means that programs got away with calling
117   g_thread_init() without explicitly listing gthread-2.0.pc among their
118   dependencies.
119
120   gthread has now been removed as a gobject dependency, which will cause
121   such programs to break.
122
123   The fix for this problem is either to declare an explicit dependency
124   on gthread-2.0.pc (if you care about compatibility with older GLib
125   versions) or to stop calling g_thread_init().
126
127 * g_debug() output is no longer enabled by default.  It can be enabled
128   on a per-domain basis with the G_MESSAGES_DEBUG environment variable
129   like
130     G_MESSAGES_DEBUG=domain1,domain2
131   or
132     G_MESSAGES_DEBUG=all
133
134 Notes about GLib 2.30
135 =====================
136
137 * GObject includes a generic marshaller, g_cclosure_marshal_generic.
138   To use it, simply specify NULL as the marshaller in g_signal_new().
139   The generic marshaller is implemented with libffi, and consequently
140   GObject depends on libffi now.
141
142 Notes about GLib 2.28
143 =====================
144
145 * The GApplication API has changed compared to the version that was
146   included in the 2.25 development snapshots. Existing users will need
147   adjustments.
148
149 Notes about GLib 2.26
150 =====================
151
152 * Nothing noteworthy.
153
154 Notes about GLib 2.24
155 =====================
156
157 * It is now allowed to call g_thread_init(NULL) multiple times, and
158   to call glib functions before g_thread_init(NULL) is called
159   (although the later is mainly a change in docs as this worked before
160   too). See the GThread reference documentation for the details.
161
162 * GObject now links to GThread and threads are enabled automatically
163   when g_type_init() is called.
164
165 * GObject no longer allows to call g_object_set() on construct-only properties
166   while an object is being initialized. If this behavior is needed, setting a
167   custom constructor that just chains up will re-enable this functionality.
168
169 * GMappedFile on an empty file now returns NULL for the contents instead of
170   returning an empty string. The documentation specifically states that code
171   may not rely on nul-termination here so any breakage caused by this change
172   is a bug in application code.
173
174 Notes about GLib 2.22
175 =====================
176
177 * Repeated calls to g_simple_async_result_set_op_res_gpointer used
178   to leak the data. This has been fixed to always call the provided
179   destroy notify.
180
181 Notes about GLib 2.20
182 =====================
183
184 * The functions for launching applications (e.g. g_app_info_launch() +
185   friends) now passes a FUSE file:// URI if possible (requires gvfs
186   with the FUSE daemon to be running and operational). With gvfs 2.26,
187   FUSE file:// URIs will be mapped back to gio URIs in the GFile
188   constructors. The intent of this change is to better integrate
189   POSIX-only applications, see bug #528670 for the rationale.  The
190   only user-visible change is when an application needs to examine an
191   URI passed to it (e.g. as a positional parameter). Instead of
192   looking at the given URI, the application will now need to look at
193   the result of g_file_get_uri() after having constructed a GFile
194   object with the given URI.
195
196 Notes about GLib 2.18
197 =====================
198
199 * The recommended way of using GLib has always been to only include the
200   toplevel headers glib.h, glib-object.h and gio.h. GLib enforces this by
201   generating an error when individual headers are directly included.
202   To help with the transition, the enforcement is not turned on by
203   default for GLib headers (it is turned on for GObject and GIO).
204   To turn it on, define the preprocessor symbol G_DISABLE_SINGLE_INCLUDES.
205
206 Notes about GLib 2.16
207 =====================
208
209 * GLib now includes GIO, which adds optional dependencies against libattr
210   and libselinux for extended attribute and SELinux support. Use
211   --disable-xattr and --disable-selinux to build without these.
212
213 Notes about GLib 2.10
214 =====================
215
216 * The functions g_snprintf() and g_vsnprintf() have been removed from
217   the gprintf.h header, since they are already declared in glib.h. This
218   doesn't break documented use of gprintf.h, but people have been known
219   to include gprintf.h without including glib.h.
220
221 * The Unicode support has been updated to Unicode 4.1. This adds several
222   new members to the GUnicodeBreakType enumeration.
223
224 * The support for Solaris threads has been retired. Solaris has provided
225   POSIX threads for long enough now to have them available on every
226   Solaris platform.
227
228 * 'make check' has been changed to validate translations by calling
229   msgfmt with the -c option. As a result, it may fail on systems with
230   older gettext implementations (GNU gettext < 0.14.1, or Solaris gettext).
231   'make check' will also fail on systems where the C compiler does not
232   support ELF visibility attributes.
233
234 * The GMemChunk API has been deprecated in favour of a new 'slice
235   allocator'. See the g_slice documentation for more details.
236
237 * A new type, GInitiallyUnowned, has been introduced, which is
238   intended to serve as a common implementation of the 'floating reference'
239   concept that is e.g. used by GtkObject. Note that changing the
240   inheritance hierarchy of a type can cause problems for language
241   bindings and other code which needs to work closely with the type
242   system. Therefore, switching to GInitiallyUnowned should be done
243   carefully. g_object_compat_control() has been added to GLib 2.8.5
244   to help with the transition.
245
246 Notes about GLib 2.6.0
247 ======================
248
249 * GLib 2.6 introduces the concept of 'GLib filename encoding', which is the
250   on-disk encoding on Unix, but UTF-8 on Windows. All GLib functions
251   returning or accepting pathnames have been changed to expect
252   filenames in this encoding, and the common POSIX functions dealing
253   with pathnames have been wrapped. These wrappers are declared in the
254   header <glib/gstdio.h> which must be included explicitly; it is not
255   included through <glib.h>.
256
257   On current (NT-based) Windows versions, where the on-disk file names
258   are Unicode, these wrappers use the wide-character API in the C
259   library. Thus applications can handle file names containing any
260   Unicode characters through GLib's own API and its POSIX wrappers,
261   not just file names restricted to characters in the system codepage.
262
263   To keep binary compatibility with applications compiled against
264   older versions of GLib, the Windows DLL still provides entry points
265   with the old semantics using the old names, and applications
266   compiled against GLib 2.6 will actually use new names for the
267   functions. This is transparent to the programmer.
268
269   When compiling against GLib 2.6, applications intended to be
270   portable to Windows must take the UTF-8 file name encoding into
271   consideration, and use the gstdio wrappers to access files whose
272   names have been constructed from strings returned from GLib.
273
274 * Likewise, g_get_user_name() and g_get_real_name() have been changed
275   to return UTF-8 on Windows, while keeping the old semantics for
276   applications compiled against older versions of GLib.
277
278 * The GLib uses an '_' prefix to indicate private symbols that
279   must not be used by applications. On some platforms, symbols beginning
280   with prefixes such as _g will be exported from the library, on others not.
281   In no case can applications use these private symbols. In addition to that,
282   GLib+ 2.6 makes several symbols private which were not in any installed
283   header files and were never intended to be exported.
284
285 * To reduce code size and improve efficiency, GLib, when compiled
286   with the GNU toolchain, has separate internal and external entry
287   points for exported functions. The internal names, which begin with
288   IA__, may be seen when debugging a GLib program.
289
290 * On Windows, GLib no longer opens a console window when printing
291   warning messages if stdout or stderr are invalid, as they are in
292   "Windows subsystem" (GUI) applications. Simply redirect stdout or
293   stderr if you need to see them.
294
295 * The child watch functionality tends to reveal a bug in many
296   thread implementations (in particular the older LinuxThreads
297   implementation on Linux) where it's not possible to call waitpid()
298   for a child created in a different thread. For this reason, for
299   maximum portability, you should structure your code to fork all
300   child processes that you want to wait for from the main thread.
301
302 * A problem was recently discovered with g_signal_connect_object();
303   it doesn't actually disconnect the signal handler once the object being
304   connected to dies, just disables it. See the API docs for the function
305   for further details and the correct workaround that will continue to
306   work with future versions of GLib.