PLEASE NOTE: the upgrades to this server,, have not yet been completed.
Hopefully the changes will be completed on THURSDAY 8th December.
Web-based programs, such as csmarks, cssubmit, and the help fora, will be unavailable at some time on Thursday 8th.
  It's UWAweek 49


This forum is provided to promote discussion amongst students enrolled in CITS2002 Systems Programming.
Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

Displaying selected article
Showing 1 of 919 articles.
Currently 4 other people reading this forum.

 UWA week 36 (2nd semester, mid-semester break) ↓
SVG not supported

Login to reply

8:06pm Sun 11th Sep, Christopher M.

> Hello kind and incredibly sympathetic person,
What happened to benevolent?!
> Is adding the line: "#define _GNU_SOURCE" ok for this project? > I have included it to make use to the strtok_r and strdup functions
Specifying _GNU_SOURCE gives the false impression that the declarations you're requiring are defined/standardised by The Free Software Foundation (FSF); it's sort of a political trick by FSF. And, if compiling code with a compiler other than gcc, defining _GNU_SOURCE may have no effect. In reality, defining _GNU_SOURCE is a 'catchall' to declare things actually standardised by other, more widely adopted standards, such as POSIX and XOPEN. The better approach is to define the precise (or minimum) standard that you require. In this case you should request a POSIX standard from, as a minimum, 2008: #define _POSIX_C_SOURCE 200809L _____ But I'm also wondering why you'd need strtok_r() for this project - the project certainly doesn't require a threaded implementation, so why the need for a re-entrant function? And, while strdup() is commonly used in C programs, in our project we know that our only stored string, command names, have a known maximum size (of 40 characters), and just storing the command names in small fixed-sized arrays will be less complicated (and faster, and use less memory).

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  1:17AM Sep 14 2022
Privacy policy