osmo-msc/openbsc/include/openbsc
Jacob Erlbeck 48bb3a37da gbproxy: Remove nonnull attributes
The compiler also uses this attribute for code elimination. If the
nonnull attribute has been given erroneously for an parameter, that
is later been checked against NULL, this check is removed silently
by the gcc if optimization is enabled. This can lead to hard-to-find
segmentation violation faults.

To be on the safe side, this patch removes all uses of the nonnull
attribute in openbsc.

Compiler:
  - gcc 4.8.2 (Ubuntu 4.8.2-19ubuntu1): no warning, segfault
  - clang 3.4 (3.4-1ubuntu3): no warning, no segfault, asm ok

Example:
  /* foo.c */
  int f(int* p) __attribute((nonnull));
  int f(int *p) {
      if (!p)
          return 0;

      return *p;
  }

  /* main.c */
  int f(int* p) __attribute((nonnull));
  int g () {
      return f(arg);
  }

  int main() {
      return g(NULL);
  }

When these files are compiled into an executable, no warnungs are
issued but it will fail with a segfault when -O2 is used (unless LTO
is active).

Compiler output (gcc -O2):
  int f(int *p) {
    0:  8b 44 24 04             mov    0x4(%esp),%eax
    4:  8b 00                   mov    (%eax),%eax
    6:  c3                      ret
  }

Sponsored-by: On-Waves ehf
2014-09-02 09:53:18 +02:00
..
Makefile.am gprs: Attempt to fix distcheck by adding the header file 2014-08-25 16:15:04 +02:00
abis_nm.h ctrl/abis: When the max_power_reduction changes, send it to the BTS 2014-03-26 18:08:22 +01:00
abis_om2000.h OM2000: First attempt in automatically configuring most MOs 2011-03-06 22:12:24 +01:00
abis_rsl.h dyn PDCH: Cleanup of rsl_chan_activate_lchan() and users 2014-08-04 08:59:16 +02:00
arfcn_range_encode.h si: Fix range1024 encoding 2014-01-16 12:04:30 +01:00
auth.h Authentication: use ENUM instead of magic numbers 2010-12-23 18:09:51 +01:00
bsc_api.h bsc: Add a ctrl command to send a ussdNotify for a call 2014-08-08 21:17:36 +02:00
bsc_msc.h bsc: Fix compilation on FreeBSD 2014-05-09 04:38:58 +02:00
bsc_nat.h nat: Introduce a config free for the test and fix valgrind issues 2014-08-29 11:42:34 +02:00
bsc_nat_callstats.h nat: Move the callstats to a new header file due sccp usage 2013-04-22 09:07:39 +02:00
bsc_nat_sccp.h nat: Remember the original dest local reference in the parsed struct 2013-09-03 15:04:43 +02:00
bsc_rll.h misc: Move from u_int to uint types of stdint.h 2011-04-18 17:31:39 +02:00
bss.h hsl: Remove the support for the HSL bts from OpenBSC 2013-07-03 16:19:41 +02:00
chan_alloc.h rsl: Rename the reason to release_mode and use the enum value 2012-12-23 20:18:18 +01:00
crc24.h crc24: Include stdint.h as a possible compile fix 2011-04-19 20:06:26 +02:00
ctrl.h move libctrl from openbsc to libosmoctrl (libosmocore.git) 2014-08-21 15:34:28 +02:00
db.h nitb/ctrl: Implement a command to list all active subscribers 2014-03-23 16:22:55 +01:00
debug.h sms: Use the DLSMS instead of the DSMS category throughout our code 2012-11-21 21:33:03 +01:00
e1_config.h fix some "implicit declaration" warnings in libbsc 2011-09-06 09:32:14 +02:00
gb_proxy.h gbproxy: Remove nonnull attributes 2014-09-02 09:53:18 +02:00
gprs_gb_parse.h gbproxy: Remove nonnull attributes 2014-09-02 09:53:18 +02:00
gprs_gmm.h src: use new library libosmogsm and new path to headers in libosmocore 2011-03-23 18:17:56 +01:00
gprs_llc.h gprs: Separate LLC parsing from LLC state handling 2014-06-04 16:29:30 +02:00
gprs_sgsn.h gprs: Fix compiler warnings in sgsn_main.c 2014-04-04 12:51:28 +02:00
gprs_utils.h gbproxy: Refactor gb_proxy.c into several files 2014-08-24 16:16:40 +02:00
gsm_04_08.h bsc: Move gsm48_tx_mm_serv_ack/rej to gsm_04_08_utils.c 2013-11-01 17:12:37 +01:00
gsm_04_08_gprs.h gprs: This comes from libosmocore, remove it here 2011-10-14 23:28:07 +02:00
gsm_04_11.h sms: Increment the RP Message Reference for each transaction 2014-02-20 11:35:56 +01:00
gsm_04_80.h src: use new library libosmogsm and new path to headers in libosmocore 2011-03-23 18:17:56 +01:00
gsm_data.h move gsm_bts_num() to gsm_data_shared.[ch] 2014-08-24 12:47:12 +02:00
gsm_data_shared.h port over to libosmocore include/osmocom/gsm/meas_rep.h 2014-08-25 09:20:33 +02:00
gsm_subscriber.h db: Remove the struct gsm_network from the database layer 2013-10-13 13:44:54 +02:00
handover.h handover: Fix the handover signalling for IP based BTSes 2012-12-26 10:32:02 +01:00
handover_decision.h fix some "implicit declaration" warnings in osmo-nitb 2011-09-06 09:32:13 +02:00
ipaccess.h move libctrl from openbsc to libosmoctrl (libosmocore.git) 2014-08-21 15:34:28 +02:00
meas_rep.h port over to libosmocore include/osmocom/gsm/meas_rep.h 2014-08-25 09:20:33 +02:00
mgcp.h osmux: add 'osmux batch-size NUM' option to mgcp vty 2014-08-29 12:30:38 +02:00
mgcp_internal.h mgcp: Store one more codec/payload type if it is present 2014-09-02 09:22:19 +02:00
mgcp_transcode.h mgcp: Make the internal state of the transcoder accessible 2014-07-22 13:12:19 +02:00
misdn.h src: port openBSC over libosmo-abis 2011-08-19 22:38:35 +02:00
mncc.h mncc: Use helper function to check if an MNCC frame is data (speech/traffic) 2014-03-20 22:36:16 +01:00
mncc_int.h Add VTY command to specify default speech codec 2011-09-03 18:23:20 +02:00
nat_rewrite_trie.h nat: Allow to use the prefix lookup to rewrite numbers 2013-07-31 16:36:40 +02:00
network_listen.h [ipaccess-config] fix bugs in generating the PHYSICAL CONFIG attribute 2010-07-22 21:54:19 +02:00
openbscdefines.h License change: We are now AGPLv3+ instead of GPLv2+ 2011-01-01 15:39:34 +01:00
osmo_bsc.h bsc: Add a ctrl command to send a ussdNotify for a call 2014-08-08 21:17:36 +02:00
osmo_bsc_grace.h bsc: Allow to page a BTS that is excluded from the RF lock 2013-01-28 15:41:27 +01:00
osmo_bsc_rf.h ctrl: Remember last 'rf_locked' control command 2013-09-11 20:27:08 +02:00
osmo_msc.h bsc_msc: Remove use_count from the subscriber connection 2010-06-28 18:01:47 +08:00
osmo_msc_data.h ussd: Send USSD on call setup on MSC errors 2013-09-11 20:18:42 +02:00
osmux.h osmux: set default port from mgcp_parse_config() 2014-08-29 12:21:58 +02:00
paging.h bsc: Allow to page a BTS that is excluded from the RF lock 2013-01-28 15:41:27 +01:00
rest_octets.h si: Another round of PCS related fixes 2013-03-10 17:39:50 +01:00
rrlp.h fix some "implicit declaration" warnings in osmo-nitb 2011-09-06 09:32:13 +02:00
rs232.h move openbsc into its own subdirectory 2009-06-10 05:40:52 +08:00
rtp.h mgcp: Use the rtp_hdr structure and extract ts/seq from there 2014-09-02 08:25:49 +02:00
rtp_proxy.h Use 'defines' for length and duration of RTP payload 2014-01-26 08:49:35 +01:00
sgsn.h sgsn: Add "auth-policy" VTY command to enable/disable ACL 2013-07-21 15:44:28 +08:00
signal.h bsc: Introduce an authenticated signal for the MSC connection 2013-01-15 11:27:28 +01:00
silent_call.h silent_call: Use the gsm_subscriber_connection instead of lchan->conn 2010-06-21 16:40:09 +08:00
sms_queue.h sms: Allow setting amount of failures through the vty. 2010-12-26 09:40:30 +01:00
socket.h src: use namespace prefix osmo_fd* and osmo_select* 2011-05-06 12:11:23 +02:00
system_information.h Move system information related defines and code to libosmocore 2011-05-24 15:02:20 +02:00
token_auth.h fix some "implicit declaration" warnings in osmo-nitb 2011-09-06 09:32:13 +02:00
transaction.h sms: Kill the linkid as we are using SAPI=3 all the time 2012-12-01 11:49:33 +01:00
trau_mux.h trau: Fix compiler warning about decoded_trau_frame 2014-02-20 11:19:32 +01:00
trau_upqueue.h fix some "implicit declaration" warnings in libtrau 2011-09-06 09:32:14 +02:00
ussd.h src: use new library libosmogsm and new path to headers in libosmocore 2011-03-23 18:17:56 +01:00
vty.h vty: Use vty_install_default() instead of bsc_install_default() 2013-10-30 15:19:00 +01:00